Case Study: DHTML.com

Chapter 11 puts what you learned in Chapter 9, "Optimizing JavaScript for Download Speed" to good use by minimizing HTTP requests and optimizing a typical .js file. For this example, I used the code from Peter Belesis' DHTML Hierarchical menus. By combining the arrays file with each API file, we save one HTTP request. By using packing and compression you can optimize a typical JavaScript file from 50 to 90% (the book demos how we combined, packed and compressed the largest DOM API file).


Table 11.1: Packing and Compressed File Size Summary
FileSize (bytes)PackGZIP -9PACK+GZIP
HM_ScriptDOM_arrays.js55,57326,87010,6557,808