File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
src/Umbraco.Cms.Api.Delivery Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 1+ using Microsoft . AspNetCore . OutputCaching ;
2+
3+ namespace Umbraco . Cms . Api . Delivery . Caching ;
4+
5+ internal sealed class NoOutputCachePolicy : IOutputCachePolicy
6+ {
7+ ValueTask IOutputCachePolicy . CacheRequestAsync ( OutputCacheContext context , CancellationToken cancellationToken )
8+ {
9+ context . EnableOutputCaching = false ;
10+
11+ return ValueTask . CompletedTask ;
12+ }
13+
14+ ValueTask IOutputCachePolicy . ServeFromCacheAsync ( OutputCacheContext context , CancellationToken cancellationToken )
15+ => ValueTask . CompletedTask ;
16+
17+ ValueTask IOutputCachePolicy . ServeResponseAsync ( OutputCacheContext context , CancellationToken cancellationToken )
18+ => ValueTask . CompletedTask ;
19+ }
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ private static IUmbracoBuilder AddOutputCache(this IUmbracoBuilder builder)
105105
106106 builder . Services . AddOutputCache ( options =>
107107 {
108- options . AddBasePolicy ( _ => { } ) ;
108+ options . AddBasePolicy ( build => build . AddPolicy < NoOutputCachePolicy > ( ) ) ;
109109
110110 if ( outputCacheSettings . ContentDuration . TotalSeconds > 0 )
111111 {
You can’t perform that action at this time.
0 commit comments