Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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 = "*")] [ChildActionOnly] 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:
<caching> <outputCacheSettings> <outputCacheProfiles> <add name="CarouselItems" duration="10" varyByCustom="url" varyByParam="*" /> </outputCacheProfiles> </outputCacheSettings> </caching>
But, it never hits my GetVaryByCustomString method. Has anyone managed to get Donut Caching working on 7.4.1?
Greg.
Try it in the global:
https://github.com/jbreuer/Hybrid-Framework-for-Umbraco-v7-Best-Practises/blob/master/Umbraco.Site/Global.asax
https://github.com/jbreuer/Hybrid-Framework-for-Umbraco-v7-Best-Practises/blob/master/Umbraco.Extensions/Utilities/Global.cs
Jeroen
Doh, of course. It's definitely Monday :D
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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:
On my action method I have the following:
And finally I have the following cache profile:
But, it never hits my GetVaryByCustomString method. Has anyone managed to get Donut Caching working on 7.4.1?
Greg.
Try it in the global:
https://github.com/jbreuer/Hybrid-Framework-for-Umbraco-v7-Best-Practises/blob/master/Umbraco.Site/Global.asax
https://github.com/jbreuer/Hybrid-Framework-for-Umbraco-v7-Best-Practises/blob/master/Umbraco.Extensions/Utilities/Global.cs
Jeroen
Doh, of course. It's definitely Monday :D
is working on a reply...