【发布时间】:2017-05-10 11:47:34
【问题描述】:
我设置了 GZIP 压缩,它适用于 css/js 文件,但不适用于 html 页面。
请帮我解决问题。
服务器已启用压缩,这里是与压缩相关的 info.php 统计信息:
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate Stream Wrapper compress.zlib:// Stream Filter zlib.inflate, zlib.deflate Compiled Version 1.2.3 Linked Version 1.2.3
这里是 .htacess 部分:
# Insert filter on all content SetOutputFilter DEFLATE # Insert filter on selected content types only AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript # Netscape 4.x has some problems... BrowserMatch ^Mozilla/4 gzip-only-text/html # Netscape 4.06-4.08 have some more problems BrowserMatch ^Mozilla/4\.0[678] no-gzip # MSIE masquerades as Netscape, but it is fine BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Don't compress images SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary
它正在压缩css和js。最初在谷歌页面洞察测试中,所有 css、js 和页面本身都显示为未压缩,现在只有页面本身。 这里还有来自 firefox web 开发者工具的screenshot。
可能是什么问题? 如果有区别,我正在使用 magento 1.9 版。
【问题讨论】: