June 22, 2008

Book: High Performance Web Sites: Essential Knowledge for Front-End Engineers

In High Performance Web Sites: Essential Knowledge for Front-End Engineers Steve Souders explains that at least 80 percent of the time it takes to display a web page happens after the HTML document has been downloaded, and describes the importance of the techniques in this book.

From the author:
"After two quick introductory chapters, I jump into the main part of this book: the 14 performance rules. Each rule is described, one per chapter, in priority order. Not every rule applies to every site, and not every site should apply a rule the same way, but each is worth considering. The final chapter of this book shows how to analyze web pages from a performance perspective, including some case studies."

HTTP Overview provides a short description of HTTP, highlighting the parts that are relevant to performance.

Rule 1: Make Fewer HTTP Requests, describes why extra HTTP requests have the biggest impact on performance, and discusses ways to reduce these HTTP requests including image maps, CSS sprites, inline images using data: URLs, and combining scripts and stylesheets.

Rule 2: Use a Content Delivery Network, highlights the advantages of using a content delivery network.

Rule 3: Add an Expires Header, digs into how a simple HTTP header dramatically improves your web pages by using the browser's cache.

Rule 4: Gzip Components, explains how compression works and how to enable it for your web servers, and discusses some of the compatibility issues that exist today.

Rule 5: Put Stylesheets at the Top, reveals how stylesheets affect the rendering of your page.

Rule 6: Put Scripts at the Bottom, shows how scripts affect rendering and downloading in the browser.

Rule 7: Avoid CSS Expressions, discusses the use of CSS expressions and the importance of quantifying their impact.

Rule 8: Make JavaScript and CSS External, talks about the tradeoffs of inlining your JavaScript and CSS versus putting them in external files.

Rule 9: Reduce DNS Lookups, highlights the often-overlooked impact of resolving domain names.

Rule 10: Minify JavaScript, quantifies the benefits of removing whitespace from your JavaScript.

Rule 11: Avoid Redirects, warns against using redirects, and provides alternatives that you can use instead.

Rule 12: Remove Duplicate Scripts, reveals what happens if a script is included twice in a page.

Rule 13: Configure ETags, describes how ETags work and why the default implementation is bad for anyone with more than one web server.

Rule 14: Make Ajax Cacheable, emphasizes the importance of keeping these performance rules in mind when using Ajax.

Deconstructing 10 Top Sites, gives examples of how to identify performance improvements in real-world web sites.
The book is a quick read containing some good hints and tips.  Many are fairly easily investigated and implemented in most companies.

Seemingly out of place, however, is Rule 2: Use a Content Delivery Network.  While it's certainly a good way to improve performance, it's not something every company can afford.

Overall, an interesting book.