How to Configure Apache to GZip Your Components
by Simon. Average Reading Time: about a minute.
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. Much like setting expires headers, this will save you bandwidth and server load, because it allows output from your server to be compressed before being sent to the client over the network.
The deflate module is not compiled by default and must be enabled in the Apache httpd.conf file. Make sure the following is present and uncommented (remove preceding the #):
LoadModule deflate_module modules/mod_deflate.so
To set GZip compression, simply add the following to the
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
Alternatively you can add it to your htaccess file in an <ifModule mod_deflate.c></ifModule> block.
All you really need is the first line. The BrowserMatch lines are there to handle issues with older browsers such as Internet Explorer 5.
You can read all about GZip by reading Yahoo!’s Best Practices for Speeding Up Your Web Site guide.
Alternatively, read the Apache mod_deflate documentation.

Pingback: 5 ways to make your web mapping fly! | Earthware Blog