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

2 Answers 2


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.


It might be you can't use the htaccess method. Here's an approach that worked for me: https://stackoverflow.com/questions/24876371/compressing-js-css-files-where-mod-deflate-not-available/25960273#25960273.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.