Magento – GZIP compression enabled in Apache but not working with Magento

gzipmagento-1.9

I have enabled gzip compression in the Magento .htaccess file but online gzip test sites show that gzip is not enabled.

<IfModule mod_deflate.c>
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

# 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 font/woff

# 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
</IfModule>

Best Answer

You are called in .htaccess is correct. if it is not work.

1. Ensure that the module file is installed.

This file is part of the core apache2 package which you should already have installed per the previously mentioned prerequisites. By default, it is found in /usr/lib/apache2/modules/mod_deflate.so.

2. Check if the module has been loaded.

Open the module configuration file /etc/apache2/mods-enabled/deflate.load , which is a symlink to /etc/apache2/mods-available/deflate.load, and ensure this line is present and not commented out:

`LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so`

Hope it will helpful for you.

Related Topic