+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Disable caching for MVC widget (OutputCacheAttribute doesn't work)

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

6 posts, 0 answered
  1. Hendrik
    Hendrik avatar
    1 posts
    Registered:
    21 Jul 2011
    10 Oct 2013
    Link to this post
    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.
  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    30 Nov 2016
    15 Oct 2013
    Link to this post
    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
  3. Adam
    Adam avatar
    23 posts
    Registered:
    05 Apr 2013
    18 Aug in reply to Stanislav Velikov
    Link to this post

    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?

  4. Bartłomiej
    Bartłomiej avatar
    0 posts
    Registered:
    07 May 2015
    14 Sep in reply to Adam
    Link to this post

    Any news regarding this topic?

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

  5. Michael
    Michael avatar
    8 posts
    Registered:
    11 Jan 2011
    14 Sep
    Link to this post
    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" />
  6. James
    James avatar
    0 posts
    Registered:
    15 Sep 2016
    20 Sep
    Link to this post

    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...

6 posts, 0 answered