Skip to content

Commit 7e82c25

Browse files
AndyButlandkjac
andauthored
Merge commit from fork
Co-authored-by: kjac <[email protected]>
1 parent 0b42085 commit 7e82c25

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Umbraco.Cms.Api.Delivery/Caching/DeliveryApiOutputCachePolicy.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ ValueTask IOutputCachePolicy.CacheRequestAsync(OutputCacheContext context, Cance
1818
.RequestServices
1919
.GetRequiredService<IRequestPreviewService>();
2020

21-
context.EnableOutputCaching = requestPreviewService.IsPreview() is false;
21+
IApiAccessService apiAccessService = context
22+
.HttpContext
23+
.RequestServices
24+
.GetRequiredService<IApiAccessService>();
25+
26+
context.EnableOutputCaching = requestPreviewService.IsPreview() is false && apiAccessService.HasPublicAccess();
2227
context.ResponseExpirationTimeSpan = _duration;
2328

2429
return ValueTask.CompletedTask;

0 commit comments

Comments
 (0)