OutPut Cache is the caching technique to cache the static pages in ASP.NET.
Questions tagged [outputcache]
680 questions
5
votes
1 answer
ASP.net MVC 3 output cache based on domain
Im developing an asp.net mvc 3 site that serves multiple domains. So based on the domains I show different content.
For example if its www.domain1.com, in homepage I show 3 images and some text. If its www.domain2.com in homepage I show only…

Juan
- 687
- 1
- 8
- 22
5
votes
1 answer
Different server & client cache policies in ASP.NET 4.0
I'm missing a little fundamental understanding of ASP.NET Output Caching.
In my case I have resources that are very strongly tied to my VaryByCustom key. On the server-side, I'd love for these to be cached indefinitely until that key changes.…

roufamatic
- 18,187
- 7
- 57
- 86
5
votes
2 answers
How to remove OutputCache on ChildAction?
I am trying to take advantage of the donut caching features in .Net MVC 3. For my Home page, in my home controller, I have:
public ActionResult Index()
{
return View();
}
[ChildActionOnly]
[OutputCache(Duration=3600)]
public ActionResult…

wilk
- 987
- 8
- 16
5
votes
2 answers
Conditional output caching in ASP.NET
I have a question on how to programmatically instruct ASP.NET to skip resolving a request from the output cache.
Imagine you've got a page output cached (e.g. http://domain/page.aspx) by means of applying cache policy settings from a CMS to the…

Anders Borum
- 135
- 10
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
5
votes
2 answers
Does VaryByParam="*" also read RouteData.Values?
in my asp.net mvc project, I enable output caching on a controller as below
[OutputCache(Duration = 100, VaryByParam = "*", VaryByHeader = "X-Requested-With")]
public class CatalogController : BaseController
{
public ActionResult Index(string…

Anwar Chandra
- 8,538
- 9
- 45
- 61
5
votes
1 answer
Stop EPiServer clearing output cache on publish
This isn't a question I've seen around, usually it's 'EPiServer isn't clearing the output cache'. I'm trying to achieve the opposite. Each time a page is published the entire cache is dropped and as the client publishes several times a day, this is…

Daniel Pickford
- 125
- 11
5
votes
1 answer
ProviderException when using a custom output cache provider RedisOutputCacheProvider
I have installed the nuget package Microsoft.Web.RedisOutputCacheProvider for use with Azure Web App running on multiple server instances following the instructions here https://msdn.microsoft.com/en-us/library/azure/dn798898.aspx and are receiving…

robmzd
- 1,813
- 3
- 20
- 37
5
votes
1 answer
ASP NET MVC OutputCache VaryByParam complex objects
This is what I have:
[OutputCache(Duration = 3600, VaryByParam = "model")]
public object Hrs(ReportFilterModel model) {
var result = GetFromDatabase(model);
return result;
}
I want it to cache a new result for each different model. At the…

Jaanus
- 16,161
- 49
- 147
- 202
5
votes
3 answers
.NET OutputCache directive not working
I've been having strange cache issues and put together a very simple .NET page with an output cache directive. However, the page is not caching (the content updates on every refresh).
I have a simple, minimal site of our CMS (Ektron v. 9.0 SP2)…

user0474975
- 149
- 3
- 13
5
votes
1 answer
Conditional Cache using OutputCacheAttribute in Asp.net MVC 4
I am trying to implement Output caching for my action results.
In my actions depending upon some business rules response is returned. In my response I send error code. I do not want to cache the response if there is any error.
Following in the…

Ashwani K
- 7,880
- 19
- 63
- 102
5
votes
2 answers
ASP.NET MVC 2 disable cache for browser back button in partial views
I am using Html.RenderAction(c => c.Show()); on my master Page to display the cart for all pages. The problem is when I add an item to the cart and then hit the browser back button. It shows the old cart (from Cache) until I hit the…

Maksymilian Majer
- 2,956
- 2
- 29
- 42
5
votes
0 answers
difference between OutputCache and MemoryCache
I have a controller action in my asp.net mvc 3 application.
My action consist of a db fetching operation and outputs the result into a view. I can use the OutputCache action filter attribute to store the action result into cache. I can also use the…

Yeasin Abedin
- 2,081
- 4
- 23
- 41
5
votes
0 answers
Response.WriteSubstitution outputs content at beginning of request
I'm trying to get WriteSubstition to work in MVC 5, and while it performs the substitution, it is doing so at the beginning of the request, instead of at the location the substitution was invoked.
I used the following extension method:
public static…

Chip Paul
- 47
- 2
5
votes
2 answers
Using Response.RemoveOutputCacheItem with RedisOutputCacheProvider
I am using the Microsoft RedisOutputCacheProvider and have a very simple PartialView which I am caching based on the current user's SessionId via VaryByCustom:
[OutputCache(VaryByCustom = "User", Duration = 3600)]
[ChildActionOnly]
public…

CodingIntrigue
- 75,930
- 30
- 170
- 176