Problem
I'm using IIS 10 to serve a .NET web app. I have Static Compression enabled on IIS server (as is the default). The app contains a big CSS file, which needs to be transferred compressed, but in spite of enabled compression, uncompressed version is being downloaded to the browser.
Screenshot from the developer console:
How can I get the server to send the compressed version of the file?
Debugging steps taken
Browser sends proper Accept-Encoding
header:
On the server, next to my 500 kB file ant-design-blazor.css
, the following files have been created:
ant-design-blazor.css.br
- 46 kB
ant-design-blazor.css.gz
- 63 kB
I've checked the request in failed request log and found that StaticCompressionModule is being invoked:
I've also added attribute staticCompressionIgnoreHitFrequency="true"
to <httpCompression>
in applicationHost.config, so the whole section now looks like this:
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" staticCompressionIgnoreHitFrequency="true">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/xaml+xml" enabled="true" />
<add mimeType="image/svg+xml" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
Any ideas why the compression is not working properly?