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 have added a composer for Output Caching. This has been working on .net 7 but not on .net 8
Please can you suggest how we can get it working.
public class OutputCacheComposer : IComposer { public void Compose(IUmbracoBuilder builder) { builder.Services.AddOutputCache(options => { options.AddPolicy("Onehour", b => { b.Expire(TimeSpan.FromHours(1)); b.Cache(); }); }); builder.Services.Configure<UmbracoPipelineOptions>(options => { options.AddFilter(new UmbracoPipelineFilter("OutputCache") { PostPipeline = app => app.UseOutputCache() }); }); } } public class DefaultController : AsyncRenderController { private readonly IModelLogic _modelLogic; public DefaultController(ILogger<DefaultController> logger, ICompositeViewEngine compositeViewEngine, IUmbracoContextAccessor umbracoContextAccessor, IModelLogic modelLogic) : base(logger, compositeViewEngine, umbracoContextAccessor) { _modelLogic = modelLogic; } [OutputCache(PolicyName = "OutputCache")] public async new Task<IActionResult> Index() { var masterModel = await _modelLogic.CreateMasterModel(CurrentPage); return this.CurrentTemplate(masterModel); } }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
How to add Output Caching in Umbraco 13?
I have added a composer for Output Caching. This has been working on .net 7 but not on .net 8
Please can you suggest how we can get it working.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.