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();