How to Configure Apache to Gzip Your Components
Compressing your Web components will help speed up your Website. The majority of your visitors will benefit as most all Web browsers support gzip compression. You’ll want to compress all text, which includes html, css, javascript, xml, json, etc.
Apache 2.x uses mod_deflate, and all you need to do is add the following to your <VirtualHost> section of your Apache configuration:
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
All you truly need is the first line. The BrowserMatch lines are there to handle issues with old browsers.
You can read all about gzipping by reading Yahoo!’s Best Practices for Speeding Up Your Website guide.
Also, be sure to check out our post on How to Set an Expires Header in Apache, which will also help speed up your Website.
Please Can you show me step by step guide to make it workable, That is how to gzip the images and all. i have access to htaccess, and how to set header expire options
Adding the “AddOutputFilterByType” line to your Apache config file (usually httpd.conf or apache2.conf) is all you have to do. It’s the only step. You don’t actually have to gzip your files — Apache takes care of that for you.