MVC Widgets being cached, not showing changes after edit
Is there an option to disable caching with MVC widgets? If I edit an item in a simple form all previous views are cached based on the output cache settings specified under administration. If I force controller authorization [Authorize] then this does not occur, otherwise I have to go into administration and disable output caching to get the result I am looking for.
I assume this has something to do with Hybrid mode pages render the MVC form using javascript instead of true forms.
Is there a workaround for this?
Hello Bobby,
Thnak you for using our services.
There is a known issue that we're working on - when creating a page template from Designer->Page Templates and from Advanced settings choose MVC Only, then creating a page based on this template, the No Cache option on the page does not work.
It does not matter what you do, the cache is always on and it does not enter into default action after the first load.
For the other modes (e.g. Hybrid like the one you're using), can you please try putting the
[System.Web.Mvc.OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
attribute above your Controller class, and let us know if any issues persist?
Regards,
Boyan Barnev
the Telerik team
I have tried this method and can confirm it doesn't work at all.
Do you have any other suggestion?
We need a method to disable caching for just the current mvc widget, not the rest of the page
Tim
Hi Tim,
Currently there is an issue with disabling caching for MVC widgets in classic mode. The problem has been logged in our bug tracking system for fixing, and hopefully we'll be able to provide a fix for it in the upcoming releases.
Please excuse us for the caused inconvenience.
Regards,
Boyan Barnev
the Telerik team
Hi Boyan,
I don't believe we're in classic mode. We have multiple dynamic module widgets on the same page.
Pretty sure disabling caching of an mvc widget in hybrid mode dorsn't work. We're on SF 5.4
Tim
Hello,
Thanks for your reply, Bobby.
Could you open a support ticket and send us your project for testing? I'm not able to replicate this on a clean site. We'll be sure to update this forum thread when a solution is found for everyone.
Thank you.
Kind regards,
Patrick Dunn
the Telerik team
I was having problems with the OutputCache attribute and got the following reply from support regarding its use:
Unfortunately, the OutputCache attribute is not supported for MVC
widgets, since in Sitefinity context, this default MVC attribute will
force and invalidate the whole page, not only the container of the MVC
widget. We have implemented a special controller proxy that should be
used for this purpose, however, it is currently unavailable for use,
because of a bug logged and described here. At this time, there is no workaround I can suggest to overcome this issue.