Questions tagged [output-caching]
37 questions
9
votes
4 answers
How do I turn off caching for my entire ASP.NET MVC 3 website?
Like the question says, I wanted to know if it's possible to turn off caching on all controllers and actions for my entire site. Thanks!

enamrik
- 2,292
- 2
- 27
- 42
7
votes
1 answer
MVC4 View cache duration in config file?
Is there a was to set the duration of caching in the web.config for MVC4 .net pages? I have :
[OutputCache(Duration = Convert.ToInt32(ConfigurationManager.AppSettings["cache.eventPage"]), VaryByParam = "Id")]
public ActionResult....
Which will not…

Nick Van Brunt
- 15,244
- 11
- 66
- 92
6
votes
1 answer
Can you force a delete of (page and partialView) OutputCache in asp.net-mvc
I want an easy way to clear cached pages on my asp.net-mvc website.
I have expensive DB operations so i often use outputcaching to make the site run faster. I have code that looks like this:
[OutputCache(Duration = 30000)]
public…

leora
- 188,729
- 360
- 878
- 1,366
6
votes
1 answer
How to use dynamic duration value in Output Caching?
I'm using ASP.NET MVC3.
I've used Output Caching on controller method.
[OutputCache(Duration = 3660, VaryByParam = "none")]
public ActionResult Index()
{
some code;
return View();
}
I want to put dynamic duration using…

Dharmik Bhandari
- 1,702
- 5
- 29
- 60
5
votes
1 answer
How can I use [OutputCache (Duration=2000)] with variable duration value and reset Server cache
I have the code below and want Duration in [OutputCache(Duration = 10)] line to have a variable value so that I can read it from DB or from a List Collection.
And I want be able to reset the server cache immediately, when Duration had changed.
How…

mgae2m
- 1,134
- 1
- 14
- 41
4
votes
2 answers
SetLastModified ignored when using an OutputCacheAttribute
I've got an ASP.NET MVC method (v3.0 on .NET 4.0) set up like the following:
[OutputCache(Duration = 31536000, Location = OutputCacheLocation.Any)]
public virtual ActionResult Item()
{
this.Response.Cache.SetLastModified(new DateTime(2011, 01,…

Greg Beech
- 133,383
- 43
- 204
- 250
3
votes
0 answers
IIS7 Output Caching - only lives in cache for 60 seconds?
I'm trying to cache the JSON output of an HTTP Handler (NOT an ASP.NET page, so the Page-level OutputCache directive does not apply). I'm running IIS 7.5 on Windows Server 2008.
I've added lines to the Web.config to enable caching in user mode (not…

Tom Sherman
- 91
- 6
3
votes
0 answers
outputCacheProfiles with Redis cache
I have an MVC web project and I am trying to setup OutputCache for some of the pages using redis cache running locally, eventually to be hosted in azure.
I have decorated my ActionResult with
[OutputCache(CacheProfile = "cacheprofile1")]
and have…

robsta
- 416
- 5
- 18
3
votes
2 answers
Disable outputcaching
I have an actionResult that I've added caching to.
[OutputCache(Duration = 120)]
When I change some elements on the page, that is cached, I want to remove the cached output. Here is what I didL
public void RemoveCachingForProfile(string guid)
{
…

Dr.Denis McCracleJizz
- 850
- 2
- 11
- 26
2
votes
0 answers
Why is Session null when using Output Caching and is there a solution for it?
I have created a custom Authorize attribute to authorize users trough a remote web API. After authorization I receive a object with token that is valid for some specific time and is used to access further information and I also get some basic user…

Dino
- 467
- 1
- 5
- 14
2
votes
1 answer
Unable to set outputCacheSettings in WebConfig file
I am Trying to implement outputcaching in my website When I try to add
This to my webconfig file…

None
- 5,582
- 21
- 85
- 170
2
votes
1 answer
Caching output of MVC actions but using the cached version only for authenticated users
I'd like to cache the output of my MVC actions. However:
1) If I apply the OutputCacheAttribute globally, it is risky as it caches everything for all users.
2) If I apply OutputCacheAttribute globally and then apply the Authorize attribute on those…

Water Cooler v2
- 32,724
- 54
- 166
- 336
2
votes
0 answers
RenderAction and Partials with output caching
I am currently setting up my mvc4 web application and have a question regarding using Partial views and Render Action.
If I apply output caching to a controller action method, will that save a request to the action method when using…

amateur
- 43,371
- 65
- 192
- 320
1
vote
1 answer
Disable cache for aspnet mvc2 site
I have a site written using MVC2 + Entity2Sql as DB backend. I'm using jQuery dialog to edit records and populate it using action returning PartialView, but after 1st call this action returns view with old data with HTTP answer 304 Not Modified.
I…

Alex G.P.
- 9,609
- 6
- 46
- 81
1
vote
2 answers
Benefit of Output Caching Compared to Caching by Browser
IIS has featured to set "Output Caching" on asp.net sites. I would like to know what is the benefit of this type of caching compared to caching done by our browser.
I am wondering because if our browser has the power to cache content(such as…

vugtis
- 33
- 5