When I use Html.RenderAction("AddProduct") in a view page ~/Views/Product/Test.aspx, and the Action "AddProduct" has the [OutputCache] attribute.
The problem is that the Action "AddProduct" 's [OutputCache] attribute has affected the view page ~/Views/Product/Test.aspx .
Could you please tell me How to made the Action "AddProduct" 's [OutputCache] attribute do not affect the view page ~/Views/Product/Test.aspx that has Html.RenderAction("AddProduct") ?
Will it be solved in the next version of MVC? It's a critical issue for our MVC application.
I don't know. If this is blocking you, you have a few options.
<div mce_keep="true">Write a filter that performs caching, as suggested by an earlier poster. Presumably such a filter would work by hooking into the response stream.</div>
<div mce_keep="true">If you're implementing caching to work around database access, you could modify your model repository to look in a cache (such as that provided by ASP.NET) before looking in the database.</div>
<div mce_keep="true">If only a particular part of your application requires partial view caching, you could use WebForms rather than MVC for that part of your application.</div>
I realize that these aren't particularly good options. :( Depending on the complexity of your application, one of the first two methods should be sufficient.
mike108mvp
Member
10 Points
22 Posts
[OutputCache] problem in Html.RenderAction()
Oct 14, 2008 04:31 PM|LINK
[OutputCache] problem in Html.RenderAction()
When I use Html.RenderAction("AddProduct") in a view page ~/Views/Product/Test.aspx, and the Action "AddProduct" has the [OutputCache] attribute.
The problem is that the Action "AddProduct" 's [OutputCache] attribute has affected the view page ~/Views/Product/Test.aspx .
Could you please tell me How to made the Action "AddProduct" 's [OutputCache] attribute do not affect the view page ~/Views/Product/Test.aspx that has Html.RenderAction("AddProduct") ?
levib
Star
7702 Points
1099 Posts
Microsoft
Re: [OutputCache] problem in Html.RenderAction()
Oct 14, 2008 06:23 PM|LINK
This is a known issue, but unfortunately we don't yet have a solution for it.
f00sion
Member
192 Points
79 Posts
Re: [OutputCache] problem in Html.RenderAction()
Oct 14, 2008 06:34 PM|LINK
No way around it without making a custom output cache attribute.
mike108mvp
Member
10 Points
22 Posts
Re: [OutputCache] problem in Html.RenderAction()
Oct 15, 2008 01:45 AM|LINK
Will it be solved in the next version of MVC? It's a critical issue for our MVC application.
levib
Star
7702 Points
1099 Posts
Microsoft
Re: [OutputCache] problem in Html.RenderAction()
Oct 15, 2008 01:51 AM|LINK
I don't know. If this is blocking you, you have a few options.
I realize that these aren't particularly good options. :( Depending on the complexity of your application, one of the first two methods should be sufficient.