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,
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

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