1

我发送的请求是接受 gzip 但响应没有压缩,相反,我收到了一些标头

Via:1.1 nc1 (NetCache NetApp/6.0.5P1)

我想这与我的 ISP 有关,因为它可以在我的家用计算机上完美运行。

知道如何压缩响应吗?

请求头

GET /test.aspx HTTP/1.1
Host    this.is.example.com
User-Agent  Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3 (.NET CLR 3.5.30729)
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
Accept-Charset  ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive  300
Pragma  no-cache
Cache-Control   no-cache

响应头

HTTP/1.1 200 OK
Date    Mon, 01 Dec 2008 19:53:40 GMT
Content-Length  6099
Content-Type    text/html; charset=utf-8
Cache-Control   private
Server  Microsoft-IIS/6.0
X-Powered-By    ASP.NET
X-AspNet-Version    2.0.50727
Via 1.1 nc1 (NetCache NetApp/6.0.5P1)
Expires 0
Cache-Control   no-cache
// I expect content-encoding to be gzip here

提前致谢。

4

1 回答 1

3

没有强制响应压缩的机制。接受编码:gzip 只告诉网络服务器/代理它可以压缩响应,而不是它必须对响应进行编码。有许多网络服务器和代理不支持开箱即用的 gzip,或者默认情况下将其配置为关闭。

您找到的 Via 标头经常由代表您连接到预期 Web 服务器的代理插入,并且是信息性的。这与您的压缩问题无关。

于 2009-04-25T14:24:10.897 回答