Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • simon kerr 31 posts 85 karma points
    Jan 06, 2015 @ 12:08
    simon kerr
    1

    mvc donut output caching

    I'm using the hybrid framework and I've upgraded one of my sites to 7.2.1. Now, all donut output caching has stopped working. My global.asax is this...

    public class Global : Umbraco.Web.UmbracoApplication
    {
        public override string GetVaryByCustomString(HttpContext context, string custom)
        {
            if (custom.ToLower() == "url")
            {
                return "url=" + context.Request.Url.AbsoluteUri;
            }
    
            return base.GetVaryByCustomString(context, custom);
        }
    
    }
    

    and I'm using a cache profile that looks like this...

    <caching>
      <outputCacheSettings>
        <outputCacheProfiles>
          <remove name="OneHour" />
          <add name="OneHour" duration="36000" varyByCustom="url" location="Server" />
        </outputCacheProfiles>
      </outputCacheSettings>
    </caching>
    

    I'm using 1.3.0 of mvcdonutcaching. I'm using the cache profile on specific actions of controllers like this...

    [DonutOutputCache(CacheProfile = "OneHour")]
    public ActionResult StandardContentPage()
    {
    

    Can anyone suggest anything else?

  • Thomas Morris 35 posts 133 karma points MVP c-trib
    May 09, 2016 @ 10:30
    Thomas Morris
    0

    For anyone that comes across this post. Here is what I'd suggest is the update (and have working)...

    <caching>
      <outputCache enableOutputCache="true" />
      <outputCacheSettings>
        <outputCacheProfiles>
          <remove name="OneHour" />
          <add name="OneHour" duration="36000" varyByCustom="url" location="Server" />
        </outputCacheProfiles>
      </outputCacheSettings>
    </caching>
    

    Note the addition of enableOutputCache = true.

Please Sign in or register to post replies

Write your reply to:

Draft