Here's what to keep in mind when you are designing your system. If your system is not expected to be heavily loaded, use simple solutions and default settings to save time. Enabling content compression can save you 30 to 50 percent off bandwidth costs; further fine-tuning may save another 1 percent. And it is a very time-consuming black art.
Remember that gunzip works much faster than gzip, so it is better to keep content compressed and decompress it on demand than compress it on the fly. Use server-side caching for compressed files where possible.
HTML and JavaScript file decompression is well supported by mainstream browsers, although decompressing external CSS files is not. Make sure that you link to any compressed JavaScript files in the head of your documents for reliable decompression.
Here's a summary of web compression tips discussed in this chapter:
For lighter loads, use simple solutions and default settings.
Pre-compress content for maximum speed.
For dynamic content, use a module or ISAPI filter specifically designed for this, like mod_gzip, mod_deflate-ru, or mod_hs for Apache and PipeBoost, VIGOS, or Hyperspace i for IIS.
For Apache 2.0x, there's only one choice: mod_deflate.
In a shared hosting situation, try gzip_cnc.
Compress HTML files and external JavaScript files referenced in the head . Avoid CSS compression.
For maximum speed or for other servers like Sun or iPlanet, consider a reverse proxy compression solution like AppCelera or VIGOS Website Accelerator.
Further Reading
|