无法在Chrome的响应标头上查看Content-Encoding属性

时间:2015-05-21 13:40:37

标签: php wordpress .htaccess gzip google-chrome-devtools

此处在Wordpress网站中,我在.htaccess启用了 gzip压缩。我检查了gzip压缩,Content-Encoding正确显示here

enter image description here

但是在Chrome的开发者工具中检查压缩时,它没有显示响应中的内容编码部分:

enter image description here

以下是.htaccess压缩语句:

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddType x-font/otf .otf
AddType x-font/ttf .ttf
AddType x-font/eot .eot
AddType x-font/woff .woff
AddType image/x-icon .ico
AddType image/png .png

为什么Chrome不会显示gzip信息?

1 个答案:

答案 0 :(得分:1)

似乎谷歌Chrome,因为Mozilla Firefox已经解码了内容。但它们之间存在差异。

请求标头中,额外字段Accept-Encoding: "gzip, deflate"显示但在响应标头中没有Content-Encoding: gzip

使用Fiddler可以单击 Transformer 按钮(来自Response Headers部分)并选择编码内容。然后单击原始按钮以检查是否正在使用内容编码。

因此,Fiddler可以更好地检查响应头。

Fiddler on the left, Firefox network debug on the right