8

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.

4 Answers 4

3

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.

1

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

1
  • Those links are all for MVC1.0. Substitution was removed from MVC2.0
    – Cheburek
    Dec 11, 2010 at 19:40
1

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.

1
  • Be careful when posting copy and paste boilerplate/verbatim answers to multiple questions, these tend to be flagged as "spammy" by the community.
    – Kev
    Aug 9, 2011 at 10:59
0

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...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.