OutPut Cache is the caching technique to cache the static pages in ASP.NET.
Questions tagged [outputcache]
680 questions
6
votes
1 answer
OutputCache and a custom gzip compression filter
I have this custom filter for compress the output of my pages:
public class EnableCompressionAttribute : ActionFilterAttribute
{
const CompressionMode compress = CompressionMode.Compress;
public override void…

vtortola
- 34,709
- 29
- 161
- 263
6
votes
1 answer
OutputCache and Authorize filters in MVC3
I am reading a book about MVC2, and in the OutputCache section it states:
Warning In the earlier section “How Authorization Filters Interact
with Output Caching,” I explained that [Authorize] has special
behavior to ensure that unauthorized…

vtortola
- 34,709
- 29
- 161
- 263
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
2 answers
IIS7.5 max-age issue(asp.net mvc output cache)
We use Windows server 2008 R2 Enterprise And IIS7.5.7600.16385,
and i deployed a simple web (asp.net mvc, c#, .net framework 4.5.1) on the server.
a controller like below, and *.cshtml only output a datetime:
public class DetailController :…

mofee
- 135
- 1
- 9
6
votes
1 answer
What is the default Duration of asp.net MVC OutputCache attribute?
We are using MVC outputcache attribute, as shown below
[OutputCache(Location = System.Web.UI.OutputCacheLocation.Server, Duration = 60 * 60 * 12, VaryByParam = "staticDataTypes;customerSubscriptionId")]
Here what is the default value of Duration?

Sparrow
- 355
- 4
- 19
6
votes
2 answers
Using ASP.NET MVC OutputCache while varying View content based on whether user is authenticated
I'm building an ASP.NET MVC 2 site where I'm using the OutputCache parameter heavily. However, I have a concern: using such caching may interfere with authentication.
On all of my pages, I display whether the user is logged in or not. Furthermore,…

Maxim Zaslavsky
- 17,787
- 30
- 107
- 173
6
votes
1 answer
OutputCache VaryByParam is varying by parameter that isn't supposed to be included
I'm using OutputCache in MVC 5 to Cache a view on the server.
I only want to cache a view based on two parameters in the query string.
Action Method
[HttpGet]
[OutputCache(Location = OutputCacheLocation.Server, Duration = 60*10, VaryByParam =…

Alex
- 1,549
- 2
- 16
- 41
6
votes
2 answers
Why does using ASP.NET OutputCache keep returning a 200 OK, not a 304 Not Modified?
i have a simple aspx page. Here's the top of it:-
<%@ Page
Language="C#"
AutoEventWireup="true"
CodeFile="Foo.aspx.cs"
Inherits="Foo" %>
<%@ OutputCache Duration="3600" VaryByParam="none" Location="Any" %>
Now, every time I hit…

Pure.Krome
- 84,693
- 113
- 396
- 647
6
votes
1 answer
ASP.NET MVC OutputCache with POST Controller Actions
I'm fairly new to using the OutputCache attribute in ASP.NET MVC.
Static Pages
I've enabled it on static pages on my site with code such as the following:
[OutputCache(Duration = 7200, VaryByParam = "None")]
public class HomeController :…

Maxim Zaslavsky
- 17,787
- 30
- 107
- 173
6
votes
1 answer
OutputCache with VaryByCustom not working
I'm trying to implement caching in ASP.NET MVC 4 using the OutputCache attribute.
Here is my controller action:
[HttpGet]
[OutputCache(Duration = CACHE_DURATION, VaryByCustom = "$LanguageCode;myParam", Location = OutputCacheLocation.Server)]
public…

Flea777
- 1,012
- 9
- 21
6
votes
3 answers
MVC OutputCache based on Session values
Is it possible to vary the output cache in MVC based on certain values in the session? I've read a lot about using the varybycustom functionality and overriding GetVaryByCustomString in Global.asax but the session is not available at this…

harman_kardon
- 1,567
- 5
- 32
- 49
6
votes
3 answers
ASP.NET OutputCache and postbacks
I'm trying to understand the ASP.NET OutputCache mechanism.
I built a test page with a Label and LinkButton.
The label text is being initialized on the server with the current server date on every PageLoad:
protected void Page_Load(object…

lnetanel
- 1,118
- 3
- 13
- 28
6
votes
2 answers
Does the OutputCacheFilter in the Microsoft MVC Preview 4 actually save on action invocations?
We deployed a live, fresh, swanky site using preview 3 including rigorous stress testing.
Page Output caching was our saviour and afforded us the ability to meet our performance contractual requirements.
My question is, is there a difference…

CVertex
- 17,997
- 28
- 94
- 124
5
votes
8 answers
ASP.net How to output cache a webusercontrol on controls public properties
I have a web user control, it serves some potentially intensive data calculations and I would like it to be output cached so that each page view doesn't recalculate the data. It resides on very frequently viewed pages so it's quite important I get…

Tom Gullen
- 61,249
- 84
- 283
- 456
5
votes
8 answers
PHP - Is it good practice to cache MYSQL queries in a txt file?
I'm building an online shop & trying to improve performance by minimising MYSQL queries.
Is it good practice to cache the mysql queries via a txt file and then fetch that instead of the query? This is what I'm doing"
A php class takes the sql query…

Emmanuel
- 4,933
- 5
- 46
- 71