Add response compression in .NET Core

services.AddResponseCompression(options => options.Providers.Add<GzipCompressionProvider>());

app.UseResponseCompression();