From 9574d7e0b603ca17e56d1755a39df4e2f7c1fec7 Mon Sep 17 00:00:00 2001 From: lihanbo Date: Thu, 31 Oct 2024 10:36:56 +0800 Subject: [PATCH] =?UTF-8?q?105040=20Update=20=E5=A2=9E=E5=8A=A0=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E4=B8=8E=E5=8E=8B=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LFlow.Base/Program.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/LFlow.Base/Program.cs b/LFlow.Base/Program.cs index ff717e2..e3b0ef6 100644 --- a/LFlow.Base/Program.cs +++ b/LFlow.Base/Program.cs @@ -26,6 +26,8 @@ public static class Program .Enrich.FromLogContext() // .WriteTo.Console() ); + builder.Services.AddResponseCompression(); + builder.Services.AddResponseCaching(); Log.Logger.Information("LoadSubService"); builder.Services.LoadSubService(); @@ -103,6 +105,10 @@ public static class Program CodeFirst.InitTable(); }); + // 启用缓存 + app.UseResponseCaching(); + // 启用压缩 + app.UseResponseCompression(); // 启用静态文件支持 app.UseStaticFiles();