Disable caching for MVC widget (OutputCacheAttribute doesn&#

Posted by Community Admin on 04-Aug-2018 08:50

Disable caching for MVC widget (OutputCacheAttribute doesn't work)

All Replies

Posted by Community Admin on 10-Oct-2013 00:00

Hello,
I've created a login widget that displays the username of logged in user or just "Login" if the user is not logged in.
The problem is that event with:
[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
the widget display sometimes the username of someone else or displays the right username but the user is not logged in anymore.

I also enabled "No Caching" under "System -> Output Cache Settings -> Output Cache Profiles" but with the same result.

We're running Sitefinity 6.1.4300.0 Small Business Edition on Windows Server 2012.

Posted by Community Admin on 15-Oct-2013 00:00

Hi,

The problem where caching settings are not applied for MVC enabled pages is a bug which is fixed in sitefinity 6.1.4700 version of sitefintiy 6.1 to make use of the fix please upgrade to this version.

Regards,
Stanislav Velikov
Telerik

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 18-Aug-2016 00:00

I'm on version 9.1 and the output cache is still not working on my controller action method: 

[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]

Is this supposed to work now?

Posted by Community Admin on 14-Sep-2016 00:00

Any news regarding this topic?

I'm also interested for 9.1 as well ass 8.2. 

Posted by Community Admin on 14-Sep-2016 00:00

I had a problem in Sitefinity 9 that I thought was output caching related, and ended up being tied to the new mvc view compilation in version 9.  MVC views are now compiled during the build process, meaning client side code changes (razor, inline js) don't show up until the application is re-compiled.  I initially thought it was just a caching issue, but after doing everything I could think of to disable caching it was still occurring.  The problem was eventually resolved by commenting out the lines in the csproj file which caused the views to be compiled during the build process:

<Import Project="Build\FeatherPrecompilation.targets" />
<Import Project="Build\RazorGenerator.MsBuild\build\RazorGenerator.MsBuild.targets" />

Posted by Community Admin on 20-Sep-2016 00:00

We're also running version 9.1 and have also created an mvc widget to show the login status. As the others have already said the OutputCache setting has no effect on caching.

Is there a workaround for this yet? If not we'll have to go back to a web forms control...

This thread is closed