PlatformPlatform icon indicating copy to clipboard operation
PlatformPlatform copied to clipboard

Add response compression

Open raix opened this issue 4 months ago • 0 comments

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)

Image

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

raix avatar Mar 04 '24 09:03 raix