PlatformPlatform
PlatformPlatform copied to clipboard
Add response compression
One of the Lighthouse findings are lack of compression, we should apply compression on the WebApp Middleware pipeline (related to serving static files via the .NET application)
Reference:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddResponseCompression(options =>
{
options.EnableForHttps = true;
});
var app = builder.Build();
app.UseResponseCompression();
app.MapGet("/", () => "Hello World!");
app.Run();