What is mod_gzip? Its an extension to the Apache Web Server to implement compression on the server side. With it installed, every page that leaves the web server gets compressed. For text pages, this is usually about 70%. So a 10KB page reduces to about 3KB. Thats a pretty good savings!
Its astonishing to me that most web servers don’t implement gzip across the board for all pages being served. Its been about 10 years since I worked on performace optimizations on the Netscape Enterprise Server, and even back then we recognized the value of really enabling gzip. But somehow, along the way, it just never was valued very highly. With broadband adoption rates going through the roof, it just never seemed to matter that much. But it really does. We should all be using it.
The good news, however, is that the browsers have all mostly implemented support for compressed pages. IE 5 & 6, Firefox, and Mozilla 5+ all support compressed pages pretty well. And for browsers that don’t support it, well, you can still just not compress.
I just installed the gzip module on my server here. The time to install took about 1 hour. That included downloading the source, compiling it, installing into my apache server, and setting up the config. Most of that was learning all the various configurations that mod_gzip offers. They do a good job of explaining the basics in their documentation, and I’ve posted a copy of those docs here.
So far, it seems to work great. I haven’t seen any problems yet, although let me know if this site is not working for you!
Lastly, here are some real numbers about why this is so important. Everyone wins when we use compression – end users get faster responses, and the overall internet bandwidth goes down too.
Most pages on my site are around 10KB. Some are 20KB, and a few are as high as 35KB. Here is a chart showing the speed improvements for various connection types:
No Compression | With Compression | |||
page size | 56Kbps modem, uncompressed | Typical DSL ~384Kbps), uncompressed | 56Kbps modem, mod_gzip | Typical DSL, mod_gzip |
10KB | 1.43s | 0.21s | 0.48s | 0.07s |
20KB | 2.86 | 0.42 | 0.95 | 0.14 |
35KB | 5 | 0.73 | 1.67 | 0.24 |
100KB | 14.29 | 2.08 | 4.76 | 0.69 |