Reputation: 8038
In my MVC3 Project I use some output caching with the OutputCache
attribute set on the action. However there are certain sections on this page that I dont want to cache ever.
Is it possible to have some partials in my view that overrides the pages caching?
Upvotes: 3
Views: 5368
Reputation: 9778
You can now get proper donut caching by downloading the MvcDonutCaching NuGet package. See http://mvcdonutcaching.codeplex.com/ and http://www.devtrends.co.uk/blog/donut-output-caching-in-asp.net-mvc-3 for more information.
Upvotes: 5
Reputation: 5606
This is called donut caching and isn't supported out of the box in MVC3. Check out my similar question here. Specifically, Jan Jongboom's Moth library which he suggests can do this (though I cannot confirm or deny this)
Upvotes: 0
Reputation: 10423
Seems like this is the answer: http://weblogs.asp.net/scottgu/archive/2006/11/28/tip-trick-implement-donut-caching-with-the-asp-net-2-0-output-cache-substitution-feature.aspx
You basically have two options:
Upvotes: 0
Reputation: 30152
Yes you are 'supposed' to be able to do this. See: Partial Views Caching in ASP.NET MVC 3
Also I use a method to disable caching for controllers here:
Disable browser cache for entire ASP.NET website
Upvotes: 0