AllowWidgetOutputCache widget inside a <cache> tag

James de Boer asked on May 9, 2025 17:05

Hopefully, quick question, if I have a widget with AllowWidgetOutputCache = true and it's inside a cache tag is it cached twice? pointlessly using up memory?

so a very cut down version of the screen would be something like this

    var options = new EditableAreaOptions
    {
        AllowedWidgets = new[] { "xxx" },
        AllowedSections = new[] { "yyy" },
        AllowWidgetOutputCache = true,
        WidgetOutputCacheExpiresAfter = TimeSpan.FromMinutes(360)
    };

    <cache priority="Microsoft.Extensions.Caching.Memory.CacheItemPriority.High" expires-sliding="@TimeSpan.FromMinutes(900)" vary-by="@Model.Page.NodeID">
        @await Html.Kentico().EditableAreaAsync("Header", options )
        ... other bits of html ...
    </cache>

Would I be correct in thinking the widget caching is pointlessly eating memory when the top level cache has it's output?

   Please, sign in to be able to submit a new answer.