Copied to clipboard

Flag this post as spam?

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

  • Greg Fyans 114 posts 273 karma points
    Feb 22, 2016 @ 09:50
    Greg Fyans

    UmbracoApplication.GetVaryByCustomString not firing

    I'm trying to get Donut Caching working per page for some controls. I'm overriding the following method in the UmbracoApplication class:

    public class ApplicationStartup : UmbracoApplication
            public override string GetVaryByCustomString(HttpContext context, string custom)
                switch (custom)
                    case "url":
                        return "url=" + context.Request.Url.AbsoluteUri;
                return base.GetVaryByCustomString(context, custom);

    On my action method I have the following:

    [DonutOutputCache(CacheProfile = "CarouselItems", VaryByCustom = "url", VaryByParam = "*")]
            public ActionResult GetCarouselItems()
                CarouselHelper helper = new CarouselHelper();
                HeaderCarouselViewModel headerCarouselViewModel = helper.GetCarouselItems(this.CurrentPage);
                return PartialView("Components/_Carousel", headerCarouselViewModel);

    And finally I have the following cache profile:

              <add name="CarouselItems" duration="10" varyByCustom="url" varyByParam="*" />

    But, it never hits my GetVaryByCustomString method. Has anyone managed to get Donut Caching working on 7.4.1?


  • Jeroen Breuer 4861 posts 12130 karma points MVP 3x admin c-trib
    Feb 22, 2016 @ 10:59
  • Greg Fyans 114 posts 273 karma points
    Feb 22, 2016 @ 11:10
    Greg Fyans

    Doh, of course. It's definitely Monday :D

Please Sign in or register to post replies

Write your reply to: