AI OnAI Off
You must enable https
services.AddResponseCompression(options =>
{
options.Providers.Add<BrotliCompressionProvider>();
options.Providers.Add<GzipCompressionProvider>();
options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(new[] { "application/json" });
options.EnableForHttps = true; // ππ»ππ»ππ»ππ»
});
I've added this now. However I still get the same result after restarting the site numerous times to make sure it was applied.
This is one of the calls that I expect to have the compression, are there any issues here?
Hi sebp
Can you confirm that UseResponseCompression is among the first lines of the Configure method? It has to come before any middleware that can produce a response, because the response is streamed back through a chain of middleware.
PS. "application/json" is already included in the default list. So that is not needed in your configuration.
After upgrading a client's solution to Optimizely 12 we are trying to apply brotli / gzip compression to api calls on the site, search for instance.
In my startup.cs I've applied the following:
... in ConfigureServices:
...and in Configure:
But when checking the Response Headers for a search api call made, it show nothing about compression whatsoever for Response:
Is there something more I need to do in order for it to be applied?