简体   繁体   中英

GZIP Compression is working for css/js but not for html

I set up GZIP Compression, it's working for css/js files, but not for html page.

Please help me troubleshoot.

Server have compression enabled, here are info.php stats related to compression:

 _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 

Here are the .htacess part:

 # 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 

It is compressing css and js. Initially on google page insights test all css, js and page itself were showed as not compressed, now only page itself. Also here is the screenshot from firefox web developers tool.

What can be a problem? I am using magento ver 1.9 if it makes difference.

For anybody with same question the problem was that hosting provider didn't enable " zlib.output_compression "

After enabling it the issue is solved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM