outputcache

There are 2 entries for the tag outputcache

Donut Hole Caching in ASP.NET MVC

A while back, I wrote about Donut Caching in ASP.NET MVC for the scenario where you want to cache an entire view except for a small bit of it. The more technical term for this technique is probably “cache substitution” as it makes use of the Response.WriteSubstitution method, but I think “Donut Caching” really describes it well — you want to cache everything but the hole in the middle. However, what happens when you want to do the inverse. Suppose you want to cache the donut hole, instead of the donut? I think we should nickname all of...

Donut Caching in ASP.NET MVC

UPDATE: Due to differences in the way that ASP.NET MVC 2 processes request, data within the substitution block can be cached when it shouldn’t be. Substitution caching for ASP.NET MVC is not supported and has been removed from our ASP.NET MVC Futures project. This technique is NOT RECOMMENDED for ASP.NET MVC 2. With ASP.NET MVC, you can easily cache the output of an action by using the OutputCacheAttribute like so. [OutputCache(Duration=60, VaryByParam="None")] public ActionResult CacheDemo() { return View(); } One of the problems with this approach is that it is an all or nothing approach....