Donut Caching in ASP.NET MVC
Posted by: youve been HAACKED,
on 06 Nov 2008 |
View original | Bookmarked: 0 time(s)
With ASP.NET MVC, you can easily cache the output of an action by using the OutputCacheAttribute like so. [OutputCach(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. What if you want a section of the view to not be cached?
Well ASP.NET does include a <asp:Substitution /> control which allows you to specify a method in your Page class that gets called every time...