How do I 'donut cache' in ASP.NET MVC for something more than a date

Posted by Simon_Weaver on Stack Overflow See other posts from Stack Overflow or by Simon_Weaver
Published on 2009-05-15T01:16:07Z Indexed on 2010/04/20 11:43 UTC
Read the original article Hit count: 303

Filed under:
|

All the examples for donut caching I've seen are just like this :

 <%= Html.Substitute( c => DateTime.Now.ToString() )%>

Thats fine if I just want the date, but what other options are there?

I know there is a delegate 'MvcSubstitutionCallback' which has the following signature :

 public delegate string MvcSubstitutionCallback(HttpContextBase httpContext);

but RenderAction and RenderPartial returns void so i cant just return them from the delegate method. How can I effectively use this callback for more complex situations.

I've looked at both of Phil Haacked's articles here and here, but neither seems to do exactly what I want.

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about donut-caching