views:

558

answers:

2

Hi

Using MVC 1.0

How can i cache a page but not a user control on it.

lets say i have a tag cloud on my master page, tag cloud being a user control that i want refreshed only every x minutes.

do i need to do [Donut caching][1]?

or has it made it to MVC 1.0 ?

can it be done in client browser or only server caching ?

[1]: http://haacked.com/archive/2008/11/05/donut-caching-in-asp.net-mvc.aspx/"Donut caching"

A: 

You have to do Donut caching on the server side. It is possible to do it on the client browser, but you would have to make a AJAX request after the fact, which is not really optimal. StackOverflow actually uses a form of this for their own tag cloud.

Nick Berardi
A: 

Yes, you have to use "post cache substitution" (also known as "donut caching"). ASP.NET automatically turns server-only caching when using "post cache substitution". Also consider using custom HtmlHelper extension method instead of UserControl (it's more ASP.NET MVC - like). There are some limitations in using "donut caching" on ASP.NET MVC. Maybe you shoud look at this question.

eu-ge-ne