gzip compression not working with IIS 8.5
Asked Answered
O

1

2

I have a Server 2012 R2 box running IIS. I've tried enabling compression for several sites running on that box, but I can't figure out why it won't work. My request headers all show accept-encoding, but the response headers are always Transfer-Encoding:chunked and Vary:Accept-Encoding. The following steps have been performed to try to get gzip compression working:

  1. Dynamic and Static compression have been enabled on each site and at the machine level
  2. Both compression methods are installed from Server Manager
  3. Httpcompression and urlcompression nodes have been manually added to web.configs
  4. Mime types are defined for compression
  5. frequentHitThreshold has been set to 1, so all content should be compressed after the first attempt to access it

A trace has been done to see why compression isn't occurring. The only information I have is the code DYNAMIC_COMPRESSION_NOT_SUCCESS with a reason of 1.

Here are the headers:

GET http://redactedservername:8082/ HTTP/1.1  
Host: redactedservername:8082  
Connection: keep-alive  
Cache-Control: max-age=0  
Accept:   text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8  
Upgrade-Insecure-Requests: 1  
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36  
DNT: 1  
Accept-Encoding: gzip, deflate, sdch  
Accept-Language: en-US,en;q=0.8  
Cookie: ASP.NET_SessionId=gnqovt55ggt22lycufudc0ns  

`

HTTP/1.1 200 OK  
Cache-Control: private  
Content-Type: text/html; charset=utf-8  
Vary: Accept-Encoding  
Date: Wed, 22 Jun 2016 14:00:57 GMT  
Transfer-Encoding: chunked

What other steps can be performed to get compression to work?

Orlantha answered 21/6, 2016 at 13:29 Comment(4)
you might also want to check the doDiskSpaceLimiting, dynamicCompressionDisableCpuUsage and staticCompressionDisableCpuUsage settings iis.net/configreference/system.webserver/httpcompressionPekingese
the DisableCpuUsage thresholds are significantly above the CPU utilization and doDiskSpaceLimiting is set to falseOrlantha
Do you connect directly to IIS (proxy, etc.) ? Could you share the HTTP request and HTTP response ?Oscitancy
No proxy is in place. Headers are being added to the original post due to length restrictions.Orlantha
O
9

Compression was working, but ESET Antivirus was doing its job of monitoring web traffic. This modified the response and I didn't get gzip content encoding as expected. Disabling ESET and testing again showed that compression was functioning.

Orlantha answered 22/6, 2016 at 19:44 Comment(2)
Same for me but I had BitDefender running. Great find!Grind
This is awesome, I spent several days investigating these issue. You saved my life :)Oily

© 2022 - 2024 — McMap. All rights reserved.