Speedup your website with Gzip on cPanel

Verify whether mod_deflate in installed or not on the server. It should be installed.

$ httpd -l | grep mod_deflate

If not, install it through easyapache.

$ /scripts/easyapache

Then add the following codes in .htaccess:

 <IfModule mod_deflate.c>
     <IfModule mod_setenvif.c>
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
       BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    </IfModule>
   <IfModule mod_headers.c>
       Header append Vary User-Agent env=!dont-vary
   </IfModule>
  <IfModule mod_filter.c>
     AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
  </IfModule>
</IfModule>

Then test it:

$ curl -A 'Mozilla/5.0 (X11; Linux i686; rv:6.0.2) Gecko/20100101 Firefox/6.0.2' -H 'Accept-Encoding: gzip, deflate' http://www.yourwebsitename.com --output filename_output

$ file filename_output


Comments

Popular posts from this blog

SVN: File remains in conflict

HowTo: Enable extended logging for exim

12 tweakings for WHM/cPanel to speed up WordPress