Preface

In eighth grade, my history class studied the efficiency experts of the Industrial Revolution. I was enthralled by the techniques they used to identify and overcome bottlenecks in manufacturing. The most elegant improvement, in my mind, was the adjustable stepstool that afforded workers of different heights the ability to more easily reach the conveyor belt—a simple investment that resulted in improved performance for the life of the process.

Three decades later, I enjoy comparing the best practices in this book to that 19th-century stepstool. These best practices enhance an existing process. They require some upfront investment, but the cost is small—especially in comparison to the gains. And once these improvements are put in place, they continue to boost performance over the life of the development process. I hope you'll find these rules for building high performance web sites to be elegant improvements that benefit you and your users.

How This Book Is Organized

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.

Chapter 1, 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.

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

Chapter 3, 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.

Chapter 4, highlights the advantages of using a content delivery network.

Chapter 5, digs into how a simple HTTP header dramatically improves your web pages by using the browser's cache.

Chapter 6, explains how compression works and how to enable it for your web servers, and discusses some of the compatibility issues that exist today.

Chapter 7, reveals how stylesheets affect the rendering of your page.

Chapter 8, shows how scripts affect rendering and downloading in the browser.

Chapter 9, discusses the use of CSS expressions and the importance of quantifying their impact.

Chapter 10, talks about the tradeoffs of inlining your JavaScript and CSS versus putting them in external files.

Chapter 11, highlights the often-overlooked impact of resolving domain names.

Chapter 12, quantifies the benefits of removing whitespace from your JavaScript.

Chapter 13, warns against using redirects, and provides alternatives that you can use instead.

Chapter 14, reveals what happens if a script is included twice in a page.

Chapter 15, describes how ETags work and why the default implementation is bad for anyone with more than one web server.

Chapter 16, emphasizes the importance of keeping these performance rules in mind when using Ajax.

Chapter 17, gives examples of how to identify performance improvements in real-world web sites.

Get High Performance Web Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.