php_nub_qq Posted October 14, 2013 Share Posted October 14, 2013 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! Quote Link to comment https://forums.phpfreaks.com/topic/282955-gzip-compression-mod_deflate-not-working/ Share on other sites More sharing options...
Solution Ch0cu3r Posted October 14, 2013 Solution Share Posted October 14, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/282955-gzip-compression-mod_deflate-not-working/#findComment-1453844 Share on other sites More sharing options...
php_nub_qq Posted October 14, 2013 Author Share Posted October 14, 2013 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. Quote Link to comment https://forums.phpfreaks.com/topic/282955-gzip-compression-mod_deflate-not-working/#findComment-1453857 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.