I\'m attempting to add Gzip middleware to my ASP.net core app.
I have added the following package :
\"Microsoft.AspNetCore.ResponseCompression\"
Solved it by putting
app.UseResponseCompression();
before
app.UseMvc();
in Startup.Configure, i.e:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseHsts();
}
app.UseResponseCompression(); // <--
app.UseHttpsRedirection();
app.UseMvc(); // <--
}