From fe2a883386aa5c87cc18c2f9731e774aa56cdf48 Mon Sep 17 00:00:00 2001 From: RahulKaushik007 Date: Tue, 21 Jan 2025 17:26:47 +0530 Subject: [PATCH 1/2] Fix static file caching headers --- Oqtane.Server/Startup.cs | 1 + Oqtane.Server/appsettings.json | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Oqtane.Server/Startup.cs b/Oqtane.Server/Startup.cs index d873bd24..7c37cc09 100644 --- a/Oqtane.Server/Startup.cs +++ b/Oqtane.Server/Startup.cs @@ -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); diff --git a/Oqtane.Server/appsettings.json b/Oqtane.Server/appsettings.json index 28270bab..128c0cda 100644 --- a/Oqtane.Server/appsettings.json +++ b/Oqtane.Server/appsettings.json @@ -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" +} \ No newline at end of file From 66a05603f741cdad7f4597c84f53043e909238ad Mon Sep 17 00:00:00 2001 From: RahulKaushik007 Date: Tue, 21 Jan 2025 17:42:08 +0530 Subject: [PATCH 2/2] Fix static file caching headers --- Oqtane.Server/appsettings.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Oqtane.Server/appsettings.json b/Oqtane.Server/appsettings.json index 128c0cda..54c22b30 100644 --- a/Oqtane.Server/appsettings.json +++ b/Oqtane.Server/appsettings.json @@ -2,10 +2,10 @@ "RenderMode": "Interactive", "Runtime": "Server", "Database": { - "DefaultDBType": "Oqtane.Database.SqlServer.SqlServerDatabase, Oqtane.Database.SqlServer" + "DefaultDBType": "" }, "ConnectionStrings": { - "DefaultConnection": "Data Source=(LocalDb)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\Oqtane-202501210838.mdf;Initial Catalog=Oqtane-202501210838;Integrated Security=SSPI;Encrypt=false;" + "DefaultConnection": "" }, "Installation": { "DefaultAlias": "", @@ -54,6 +54,5 @@ "LogLevel": { "Default": "Information" } - }, - "InstallationId": "60faae5c-96ea-4416-9abf-9203fd9e3d8d" + } } \ No newline at end of file