https://docs.microsoft.com/zh-cn/aspnet/core/performance/response-compression?view=aspnetcore-6.0
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddResponseCompression(options =>
{
options.EnableForHttps = true;
});
var app = builder.Build();
app.UseResponseCompression();//用户响应压缩,全局有效(只有这一行代码)
app.MapGet(“/”, () => “Hello World!”);
app.Run();
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/282349.html