Search code examples
iisgzipiis-10

GZip compression not working on Windows Server 2016


I have the dynamic GZip module installed, and the relevant settings set in IIS, but when I test my images, each site I use tells me GZip is not installed.

  • ASP.net v4.6
  • Windows Server 2016
  • IIS 10.0

Request header:

Host: [redacted]
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Cookie: [redacted]
Upgrade-Insecure-Requests: 1
If-Modified-Since: Mon, 16 Sep 2019 15:23:43 GMT
If-None-Match: "b5b591b9a26cd51:0"
Cache-Control: max-age=0
TE: Trailers 

Response header:

HTTP/2.0 200 OK
content-type: image/x-icon
last-modified: Wed, 06 Sep 2017 09:19:33 GMT
accept-ranges: bytes
etag: "87b86540f126d31:0"
server: Microsoft-IIS/10.0
x-powered-by: ASP.NET
date: Thu, 31 Oct 2019 00:45:49 GMT
content-length: 1150
X-Firefox-Spdy: h2

IIS setting:

enter image description here

Web.config:

    <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" dynamicCompressionDisableCpuUsage="90" dynamicCompressionEnableCpuUsage="0">
      <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
        <dynamicTypes>
            <add mimeType="text/*" enabled="true" />
            <add mimeType="message/*" enabled="true" />
            <add mimeType="application/javascript" enabled="true" />
            <add mimeType="application/x-javascript" enabled="true" />
            <add mimeType="image/jpeg" enabled="true" />
            <add mimeType="*/*" enabled="false" />
        </dynamicTypes>
        <dynamicTypes>
            <add mimeType="text/*" enabled="true" />
            <add mimeType="message/*" enabled="true" />
            <add mimeType="application/javascript" enabled="true" />
            <add mimeType="application/x-javascript" enabled="true" />
            <add mimeType="image/png" enabled="true" />
            <add mimeType="*/*" enabled="false" />
        </dynamicTypes>
        <staticTypes>
            <add mimeType="text/*" enabled="true" />
            <add mimeType="message/*" enabled="true" />
            <add mimeType="application/javascript" enabled="true" />
            <add mimeType="application/x-javascript" enabled="true" />
            <add mimeType="image/jpeg" enabled="true" />
            <add mimeType="*/*" enabled="false" />
        </staticTypes>
        <staticTypes>
            <add mimeType="text/*" enabled="true" />
            <add mimeType="message/*" enabled="true" />
            <add mimeType="application/javascript" enabled="true" />
            <add mimeType="application/x-javascript" enabled="true" />
            <add mimeType="image/png" enabled="true" />
            <add mimeType="*/*" enabled="false" />
        </staticTypes>
    </httpCompression>

GZip test:

enter image description here


Solution

  • FREB helped me identify some settings in my web.config were problematic. I cleared out all the configuration and did it via IIS and GZIP is now working.