If you're using ASP.NET Core 2.x, you need to install the NuGet Microsoft.AspNetCore.ResponseCompression
public void ConfigureServices(IServiceCollection services)
{
services.Configure<GzipCompressionProviderOptions>(options =>
{
options.Level = CompressionLevel.Fastest;
});
services.AddResponseCompression(options =>
{
options.Providers.Add<GzipCompressionProvider>();
});
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseResponseCompression();
}
Top comments (0)