Last post Mar 13, 2020 03:02 PM by neoaguil17
Mar 12, 2020 03:21 PM|neoaguil17|LINK
I applied compression in web api core, but I see the same result with and without compression:
I followed the link:
Mar 12, 2020 03:51 PM|bruce (sqlwork.com)|LINK
as you don't show the response headers, we can not tell if it worked. check that the gzip accept header was sent, also check the content-encoding response header (should be gzip)
also check that you are not using http/2 which has compression built in and does not use gzip.
Mar 12, 2020 03:57 PM|mgebhard|LINK
Please do not make the community guess what your doing. At least share your code, tell us what version of Core you are targeting, explain how you are testing, and the steps to reproduce this behavior..
Mar 13, 2020 12:06 AM|neoaguil17|LINK
This is the response...
I don't see content-encoding: gzip in the response.
Mar 13, 2020 04:07 AM|Yang Shen|LINK
link article you provied, missed a very important thing for your situation that you have to set EnableForHttps to be true.
public void ConfigureServices(IServiceCollection services)
// Configure Compression level
services.Configure<GzipCompressionProviderOptions>(options => options.Level = CompressionLevel.Optimal);
// Add Response compression services
options.EnableForHttps = true;
Mar 13, 2020 02:36 PM|neoaguil17|LINK
I did it but the response has the same time and size.
Mar 13, 2020 03:02 PM|neoaguil17|LINK
I identify that gzip compression doesn't work in iis express, it only works in IIS onpremise or azure appservice.