Jump to content

Gzip compression (mod_deflate) not working


php_nub_qq
Go to solution Solved by Ch0cu3r,

Recommended Posts

I have just added, or tried to add, gzip compression to my website in order to make it faster. This is the code I have put into .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>

So now I'm using a firebug extension called PageSpeed to monitor gzip compression and it is not working. I also use http://gtmetrix.com/ and the results are the same. Can anyone explain to me what more I have to do to enable gzip compression? Big thanks!

Link to comment
Share on other sites

  • Solution

Your .htaccess code is checking to see if this module has been loaded and then configuring how files are compressed. It is not loading the deflate module

 

You need to enable the deflate modue within the httpd.conf file. You do this by removing the # infront of this line

LoadModule deflate_module modules/mod_deflate.so

Save httpd.conf and restart Apache.

Link to comment
Share on other sites

Your .htaccess code is checking to see if this module has been loaded and then configuring how files are compressed. It is not loading the deflate module

 

You need to enable the deflate modue within the httpd.conf file. You do this by removing the # infront of this line

LoadModule deflate_module modules/mod_deflate.so

Save httpd.conf and restart Apache.

 

Thank you for the reply #Ch0cu3r,

 

I'm using a hosting service and I have no access to httpd.conf. I will ask them if the module is available, but it is a very popular hosting company so I truly believe it is. I will post again if I'm right and the cause of the problem is still unknown.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.