Donut Caching ASP.NET MVC2
开发者_高级运维Is there a possibility to do Donut Caching with MVC2? Even with a lot of research I was not able to find a working solution.
Donut caching does not work with ASP.NET MVC 2, see http://forums.asp.net/t/1521502.aspx :
Supporting donut caching would require view engines to be able to send an array consisting of literal text + callbacks to the writer. This is a major plumbing change and is not something that will be included in v2 of the product.
Not Supported != Not Possible
http://blog.maartenballiauw.be/post/2008/07/01/Extending-ASPNET-MVC-OutputCache-ActionFilterAttribute-Adding-substitution.aspx
http://www.klopfenstein.net/lorenz.aspx/output-donut-caching-attribute-asp-net-mvc-partial-requests
http://haacked.com/archive/2009/05/12/donut-hole-caching.aspx
Cross-post from another question:
Donut Caching (yes, the real thing) is available as part of my 'speed-lib' for MVC: Moth. Works in both ASP.NET MVC 2 and MVC 3.
Docs are at the wiki, and examples are in the Mvc3.Demo folder.
I think this may be useful. It is possible using Html.Action and passing HttpContextBase instance to the child controller. Check it http://eliasbland.wordpress.com/2010/04/08/donut-caching-in-asp-net-mvc-2-with-html-action/
but I don't know if it works properly so far...
精彩评论