This is an issue, I just ran into this today. Please reopen. It took me a while to debug.
Here are my observations:
Asp.Net Core gzips css and js bundles without any configuration
I've added ResponseCompression to also gzip static SVGs in my project:
services.AddResponseCompression(o =>
{
o.MimeTypes = new[] { "image/svg+xml" };
});
When I run this from with VS (IIS Express) I get my SVG's gzipped
When I deploy and this runs under Win 2012 R2 under IIS which has static and dynamic compression OFF nothing is GZipped (not even the bundles)
My conclusion is that IIS acting as a proxy decompresses incoming requests and serves them plain.
Blank rule for dynamic compression ON is NOT an option because of CRIME.
Copied from original issue: aspnet/StaticFiles#194
I had the same problem. If use HTTPS try add EnableForHttps
services.AddResponseCompression(o =>
{
o.MimeTypes = new[] { "image/svg+xml" };
o.EnableForHttps = true;
});
From @oliverjanik on May 9, 2017 14:4
Reposted from #119:
This is an issue, I just ran into this today. Please reopen. It took me a while to debug.
Here are my observations:
Asp.Net Core gzips css and js bundles without any configuration I've added ResponseCompression to also gzip static SVGs in my project: services.AddResponseCompression(o => { o.MimeTypes = new[] { "image/svg+xml" }; });
When I run this from with VS (IIS Express) I get my SVG's gzipped
When I deploy and this runs under Win 2012 R2 under IIS which has static and dynamic compression OFF nothing is GZipped (not even the bundles)
My conclusion is that IIS acting as a proxy decompresses incoming requests and serves them plain.
Blank rule for dynamic compression ON is NOT an option because of CRIME.
Copied from original issue: aspnet/StaticFiles#194