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
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.