Skip to content

Commit b999cc1

Browse files
committed
feat: enhance cache refresh functionality by adding eviction for policy-based cache entries
1 parent 1ec2c0e commit b999cc1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Web/Extensions/EndpointExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@ public static class EndpointExtensions
235235
await outputCacheStore.EvictByTagAsync("Web.Pages.Tips.TagModel", default);
236236
await outputCacheStore.EvictByTagAsync("Web.Pages.Tips.DetailsModel", default);
237237

238+
// Add these to evict policy-based cache entries
239+
await outputCacheStore.EvictByTagAsync("outputcache", default);
240+
await outputCacheStore.EvictByTagAsync("site", default);
241+
await outputCacheStore.EvictByTagAsync("static", default);
242+
await outputCacheStore.EvictByTagAsync("dynamic", default);
243+
238244
logger.LogInformation("Cache refresh completed successfully (content and output cache) in {Environment} environment", environment.EnvironmentName);
239245
return Results.Ok(new {
240246
message = "Content and output cache refreshed successfully",

0 commit comments

Comments
 (0)