Gzip Compression with mod_deflate

Gzip Compression with mod_deflate

Mod_Deflate is used by Apache 2nd generation, which mod_gzip was with Apache 1.3.xx. To make apache web-server compress all javascript and css files we use mod_deflate module. By adding these lines to .htaccess or httpd.conf or vhost.conf file depending upon your upon web-hosting configuration.



 AddType application/x-javascript .js
 AddType text/css .css


 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 application/javascript
 
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
 
 
  Header append Vary User-Agent env=!dont-vary