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 05, 2015 @ 14:10
    simon kerr
    0

    donut output caching

    I haven't started with the v7 framework but upgraded the v6 one. Its all working apart from the donut output caching, which has broken. I'm on umbraco 7.2.1 now but for every controller action with a caching attribute on it, the action is still executed. What am I missing?

    this is the set up

    (web.config)

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

    (controller)

    [DonutOutputCache(CacheProfile = "OneHour")]
    public ActionResult StandardPage()
    {
    
  • Dan Lister 416 posts 1974 karma points c-trib
    Jan 05, 2015 @ 14:30
    Dan Lister
    0

    Hi Simon,

    Have you extended Global.asax and implemented your own custom vary by string?

    Global.asax:

    <%@ Application Codebehind="Global.asax.cs" Inherits="MyApplication.GlobalApplication" Language="C#" %>
    

    Global.asax.cs:

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

    Hope that helps.

    Thanks, Dan.

  • Dan Lister 416 posts 1974 karma points c-trib
    Jan 05, 2015 @ 14:33
    Dan Lister
    0

    Hi Simon,

    Sorry, I've just realised what forum you posted in. Ignore my previous post as the Hybrid Framework already has the above :)

    Thanks, Dan.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jan 12, 2015 @ 12:05
    Jeroen Breuer
    0

    Hello,

    I haven't tried to upgrade the v6 version to v7 because it would break too many things. Is there something in the error log that could help?

    Jeroen

  • Robert Lundberg 14 posts 60 karma points
    Feb 16, 2015 @ 16:07
    Robert Lundberg
    0

    Hi,

    I am also experiencing problem with the donut output caching, I have upgraded version 7 of the hybrid framework to use umbraco version 7.2.1.
    now I get the same output for same controllers. I noticed that the GetVaryByCustomString method in global.cs is never hit.

    //Robert

     

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Feb 16, 2015 @ 16:19
    Jeroen Breuer
    0

    Hello,

    When you upgraded you've probably overridden the Global.asax file. It should inherit from Umbraco.Extensions.Utilities.Global: https://github.com/jbreuer/Hybrid-Framework-for-Umbraco-v7-Best-Practises/blob/master/Umbraco.Site/Global.asax

    Jeroen

  • Robert Lundberg 14 posts 60 karma points
    Feb 16, 2015 @ 16:36
    Robert Lundberg
    0

    That was the problem!
    Thanks Jeroen,

    //Robert

     

Please Sign in or register to post replies

Write your reply to:

Draft