我看到来自同一服务器的其他响应被gzip压缩。我有一个没有被gzip压缩的URL。我只能认为问题可能是内容的大小,但我发现IIS 8中没有与大小限制有关的设置。
安装并启用所有静态和动态以及url和http压缩。我无法找到任何包含有关此URL未被压缩的有用信息的日志。
例如,从IIS gzip压缩的响应。 (参见回复标题Content-Encoding: gzip
)
curl 'http://....../small_json/' -H 'Accept-Encoding: gzip, deflate' -H 'Accept: application/json, text/plain, */*' --compressed -D /tmp/headers.txt -o /dev/null; cat /tmp/headers.txt
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 65382 100 65382 0 0 233k 0 --:--:-- --:--:-- --:--:-- 233k
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Content-Encoding: gzip
Content-Language: en
Vary: Accept, Accept-Language, Cookie,Accept-Encoding
Server: Microsoft-IIS/8.5
X-Frame-Options: SAMEORIGIN
Date: Sun, 08 Apr 2018 01:50:54 GMT
Content-Length: 65382
较大的JSON响应没有Content-Encoding: gzip
:
curl 'http://....../big_json/' -H 'Accept-Encoding: gzip, deflate' -H 'Accept: application/json, text/plain, */*' --compressed -D /tmp/headers.txt -o /dev/null; cat /tmp/headers.txt
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4755k 0 4755k 0 0 1018k 0 --:--:-- 0:00:04 --:--:-- 1373k
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Content-Language: en
Vary: Accept, Accept-Language, Cookie
Server: Microsoft-IIS/8.5
X-Frame-Options: SAMEORIGIN
Date: Sun, 08 Apr 2018 01:51:11 GMT
我已将压缩设置设置为非常宽松:
非压缩响应的FERB信息: