gzip compression not working with IIS 8.5

爷,独闯天下 提交于 2019-12-11 01:07:22

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/37945845/gzip-compression-not-working-with-iis-8-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!