YSLow 提示某些 CSS 未经过 gzip 压缩

YSLow 提示某些 CSS 未经过 gzip 压缩

Yslow 一直告诉我类似这样的文件http://www.example.com/wp-content/plugins/q-and-a/css/qa-plus.css?ver=1.0.6.2未被压缩,而 gzip 测试工具喂食机器人提到我一切都好:

Compressed? Yes
Compression type    gzip
Page size (Bytes)   32,493
Compressed size (Bytes) -1
Saving (Bytes)  32,494
Compression %   100%

我将其添加到我的.htaccess 中:

# Gzip

<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

#Deflate

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>

所提及的文件的标题指出:

CF-Cache-Status MISS
CF-RAY  13945df90a9a0c1d-AMS
Cache-Control   public, max-age=2592000
Connection  keep-alive
Content-Encoding    gzip
Content-Type    application/javascript
Date    Thu, 12 Jun 2014 07:34:38 GMT
Expires Sat, 12 Jul 2014 07:34:38 GMT
Last-Modified   Thu, 21 Feb 2013 01:29:18 GMT
Server  cloudflare-nginx
Transfer-Encoding   chunked
Vary    Accept-Encoding

我的 gzip 代码正确吗?

相关内容