Score:0

IIS 10 is sending uncompressed version of CSS file

ro flag

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: uncompressed file is being transferred

How can I get the server to send the compressed version of the file?

Debugging steps taken

Browser sends proper Accept-Encoding header: the browser accepts compression

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: compression module

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?

djdomi avatar
za flag
i am not a pro on IIS as i am not using it only on certain situations, try a look at https://www.codeproject.com/Articles/242133/Making-the-most-out-of-IIS-compression-Part-1-conf - it looks for me a great guide - however as i understand the usage correctly, only in case if CPU is avaible it will be applied
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.