i have installed mvcdonutcaching from GitHub and included it in my MVC Project
i have the Index Action for Home Controller and i am successfully using Caching on it
[DonutOutputCache(Duration = 24 * 60 * 60, Location = System.Web.UI.OutputCacheLocation.Any)]
public ActionResult Index()
{
return View();
}
and in my view i am calling 2 Partial Views .
<div class="container">
@Html.Partial("BlogPosts")
@Html.Partial("RightSideBar")
</div>
View BlogPost is dynamic so i don't want it to be cached but RightSideBar needs to be cached
so how can i set the BlogPost not to be cached the DonutOutputCache sets the total view to be cached including both partial views
If you want to take advantage of MvcDonutCaching "donut" ability, you have to create an Action in your controller (ie. BlogPost()) that returns your PartialView.
Once you have this, you can modify your initial view to use one the library HtmlHelpers :
Regards.