I'm on project using asp.net mvc2.
In master page I have some lines of code line this
<% Html.RenderPartialView("Header", Model.HeaderData) %>
...
<% Html.RenderPartialView("LeftMenu", Model.MenuData) %>
...
&l开发者_运维技巧t;% Html.RenderPartialView("Footer") %>
How could I apply caching to RenderPartialView
Thanks
You can not easily - the main problem is that at that at that point the caching thing is already done. it is executing the page construction.
Check http://www.klopfenstein.net/lorenz.aspx/output-donut-caching-attribute-asp-net-mvc-partial-requests for some stuff in this direction (including a nice discussion how caching workd under the hood).
精彩评论