Merge pull request #5007 from RahulKaushik007/fix-static-file-caching

Fixes #5005: Add Browser Caching for Static Assets
This commit is contained in:
Shaun Walker 2025-01-28 13:21:29 -05:00 committed by GitHub
commit c4308c239c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -205,6 +205,7 @@ namespace Oqtane
ServeUnknownFileTypes = true,
OnPrepareResponse = (ctx) =>
{
ctx.Context.Response.Headers.Append("Cache-Control", "public, max-age=604800");
var policy = corsPolicyProvider.GetPolicyAsync(ctx.Context, Constants.MauiCorsPolicy)
.ConfigureAwait(false).GetAwaiter().GetResult();
corsService.ApplyResult(corsService.EvaluatePolicy(ctx.Context, policy), ctx.Context.Response);

View File

@ -55,4 +55,4 @@
"Default": "Information"
}
}
}
}