OutPut Cache is the caching technique to cache the static pages in ASP.NET.
Questions tagged [outputcache]
680 questions
3
votes
2 answers
OutputCache expiring prior to duration
I'm using a very simple outputcache directive on an ASP.NET 4.0 Webforms application (IIS 7.5), that caches pages for 1 hour. The application is not under any memory pressure, yet pages expire well before one hour. I created a test page that simply…

JNappi
- 1,495
- 1
- 14
- 24
3
votes
0 answers
Where to call HttpResponse.RemoveOutputCacheItem()?
I use the below code for caching
public class HomeController : Controller
{
[OutputCache(Location=OutputCacheLocation.Server, Duration = 1000, VaryByParam = "id")]
public ActionResult Index(string id)
{
ViewBag.Message = "Welcome…

AnyOne
- 931
- 2
- 12
- 40
3
votes
2 answers
Output cache in content and master page
Two questions:
1. If I have a content page and a master page and I put this inside my content page:
<%@ OutputCache ...%>
Does it cache the whole page or only the content page portion?
2. How can I apply OutputChace in the master page?
I have a…

Nir
- 2,497
- 9
- 42
- 71
3
votes
1 answer
can you use output caching in asp.net-mvc based on the parameters of your controller action
i want to use output caching to avoid hitting my db over and over with the same static query but my controllers have parameters that uniquely define the post.
How can i factor in my parameters and still support output caching in asp.net-mvc?

leora
- 188,729
- 360
- 878
- 1,366
3
votes
1 answer
ASP.NET MVC: OutputCache attribute disregards RequireHttps attribute?
I have an ASP.NET MVC 3 application with an action that uses both the RequireHttps and OutputCache attributes:
[RequireHttps]
[OutputCache(Duration = 14400, VaryByCustom = "CurrentUser"]
public ActionResult VersionB()
{
return View();
}
When I…

Tom Lokhorst
- 13,658
- 5
- 55
- 71
3
votes
2 answers
URL rewrite + outputcache
I've got a problem using outputcache together with urlrewriting. We've got an application that rewrites url (IE http://localhost/about/) to "~/page.aspx". Based on the URL (/about/) we figure out which content to show.
Now we're trying to add…

Asphyxion
- 31
- 3
3
votes
1 answer
How to pull a ViewComponent outside a response cached controller's action in ASP.NET Core
For performance purposes, I need to cache the results of the homepage action, while allowing the display name of the logged-in user to remain uncached.
I used to achieve something similar on ASP.NET MVC Framework projects using DonutOutputCache.…

Bidasse
- 43
- 5
3
votes
1 answer
AsyncController OutputCache
When implementing an asynchronous controller action in ASP.NET MVC, if I want to output cache the ActionResult, which method do I put the OutputCache attribute on?
public class PortalController : AsyncController {
/// HERE...?
…

Jacob Krall
- 28,341
- 6
- 66
- 76
3
votes
3 answers
IIS7.5 OutputCacheModule kernel caching 'public' ignoring URL
Have some strange behaviour regarding output caching in an ASP.NET 4 application on IIS 7.5. I've been able to repeat the problem simply on other empty setups, I'm certain this is a bug, but unsure how to report it to Microsoft.
A site in IIS…

simbolo
- 7,279
- 6
- 56
- 96
3
votes
1 answer
When should I not set @OutputCache Shared Attribute in Webforms?
Reading the @OutputCache documentation in MSDN I have noticed the Shared attribute
Doc says:
Shared
A Boolean value that determines whether user control output can be
shared with multiple pages. The
default is false. For more
information, see…

Carlos Muñoz
- 17,397
- 7
- 55
- 80
3
votes
1 answer
Anyone get Silverlight Ria Domain Service OutputCaching to work?
I am trying to use client side caching in silverlight by decorating a domain service in a RIA Service like so:
[OutputCache(OutputCacheLocation.Client,3600,UseSlidingExpiration = true)]
public IQueryable GetMyStates()
{
return…

Marc Ziss
- 659
- 6
- 10
3
votes
0 answers
Postbacks and output caching on user controls
There is a well known issue with using output caching on aspx pages which postback, where Asp.Net returns the cached page, instead executing the postback logic
I came across what seems like an elegant solution here
However this doesn't seem to work…

Matt Evans
- 7,113
- 7
- 32
- 64
3
votes
2 answers
How can I use outputcache at this situation?
In my application, I will remember user's language choice in session.
The problem is if I use output cache, then the change language function will not work, because it caches the result when I retrieve from database according to the Session["lang"]…

MemoryLeak
- 7,322
- 23
- 90
- 133
3
votes
1 answer
Where is my max-age header coming from?
I'm well aware of how I could set it myself, but I am concerned about having it configured in two different places. To receive the bounty, please tell me where I should look to find the existing setting.
Places we've already looked for the existing…

John Wu
- 50,556
- 8
- 44
- 80
3
votes
1 answer
Is it possible to modify the default outputcache settings
I'm trying to do something similar to this question, I have a multitenant application and want to configure the output cache to be per tenant. However I'd rather not have to use a custom OutputCacheAttribute or have an OutputCache profile and…

Luke Smith
- 23,504
- 8
- 29
- 28