Fix static file caching headers

This commit is contained in:
RahulKaushik007 2025-01-21 17:26:47 +05:30
parent d1f78f9048
commit fe2a883386
2 changed files with 6 additions and 4 deletions

View File

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

View File

@ -2,10 +2,10 @@
"RenderMode": "Interactive", "RenderMode": "Interactive",
"Runtime": "Server", "Runtime": "Server",
"Database": { "Database": {
"DefaultDBType": "" "DefaultDBType": "Oqtane.Database.SqlServer.SqlServerDatabase, Oqtane.Database.SqlServer"
}, },
"ConnectionStrings": { "ConnectionStrings": {
"DefaultConnection": "" "DefaultConnection": "Data Source=(LocalDb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Oqtane-202501210838.mdf;Initial Catalog=Oqtane-202501210838;Integrated Security=SSPI;Encrypt=false;"
}, },
"Installation": { "Installation": {
"DefaultAlias": "", "DefaultAlias": "",
@ -54,5 +54,6 @@
"LogLevel": { "LogLevel": {
"Default": "Information" "Default": "Information"
} }
} },
"InstallationId": "60faae5c-96ea-4416-9abf-9203fd9e3d8d"
} }