Gzip压缩(mod_deflate)不起作用

时间:2013-10-13 16:08:23

标签: apache .htaccess compression gzip

我刚刚添加或尝试添加gzip压缩到我的网站,以使其更快。这是我从this answer获得的.htaccess代码。

<IfModule mod_deflate.c>
    #The following line is enough for .js and .css
    AddOutputFilter DEFLATE js css
    #The following line also enables compression by file content type, for the following list of Content-Type:s
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml
    #The following lines are to avoid bugs with some browsers
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html 
</IfModule>

所以现在我正在使用名为PageSpeed的firebug扩展来监视gzip压缩,但它无法正常工作。我也使用http://gtmetrix.com/,结果是一样的。任何人都可以向我解释我还需要做些什么来启用gzip压缩?非常感谢!

0 个答案:

没有答案