Book Review: Speed Up Your Site

Book Details

Title: Speed Up Your Site: Web Site Optimization
Author: Andrew B. King
Publisher: New Riders, $39.99
ISBN: 0735713243
Pages: 528
Book web site: http://www.websiteoptimization.com/speed/

While developing sites, it is all too easy to hastily comment and uncomment out code while tweaking a layout, to create overly verbose style sheets, or to use excessively meaty graphics, and neglect to clean up these bits of bloat after the fact. Andy King reminds us "pages are not digital dumping grounds," and has produced, with Speed up Your Site: Web Site Optimization, a focused book that should be on any web developer's bookshelf. This book guides us away from creating pages that are "digital dumping grounds" to the creation of lean, fast pages that will improve the experience of your sites' visitors.

What's Covered

Part I - The Psychology of Performance tells us why we should care about optimization. An optimized site, Andy tells us, will have many benefits beyond simply allowing its visitors to navigate around it more quickly. For one, he points to studies that have found many users perceive quick and efficient sites as being more secure and of a higher quality than slow sites. He also examines the concept of "Flow," which can be experienced online when users are engaged and enjoying their experience on a site. Marketers have long known that engaged users are more likely to make purchases, and users who are experiencing Flow are certainly engaged. One of the key components helping to enable the experience of flow on web sites is, of course, speed.

Part II - Optimizing Markup: HTML and XHTML begins the rest of the book's focus on the technical means towards optimizing sites. This part outlines some obvious byte-reducing techniques, such as removing unneeded HTML comments, removing unnecessary meta tags, using trailing slashes on links to directories to eliminate the unneeded redirect to the directory's index file that would otherwise occur, and removing excessive whitespace from your markup. Other, less obvious techniques covered include enabling incremental table rendering with sized col elements, using CSS instead of HTML attributes to style table elements, minimizing the size of a page's <head> to increase the speed at which the body displays, moving default form variables from hidden form elements to the script itself, and using gracefully degrading JavaScript to save clicks and http requests for forms. The chapter on XHTML optimization points out that this markup language is more strictly defined and, thus, offers less flexibility for optimization, but its use also pulls developers away from mixing presentation information into the markup, which inherently leads to speedier, more optimized pages. This section, like all of the following ones, ends with a case study, where King applies the book's techniques to a particular site, in this case PopularMechanics.com. The case study does a good job of demonstrating how multiple small, seemingly trivial optimizations to a site's markup can cumulate into a significant reduction in file size.

In Part III - DHTML Optimization: CSS and JavaScript, King applies his byte-shaving techniques to CSS and JavaScript. Again, he presents a number of common sense approaches to optimize these technologies, such as removing excess whitespace from CSS and JavaScript files, using CSS whenever possible to replace images or scripted effects (JavaScript rollovers, for example), using CSS shorthand properties (i.e., margin: 0; instead of margin-top: 0;, margin-left:0;, etc. ), and combining CSS and JavaScript files whenever possible to minimize HTTP requests. More subtle techniques like defining style as high in the document tree as possible (i.e., defining style for <body> instead of <p>) and segmenting JavaScript to allow you to load only that which is necessary for a particular platform as also covered. King also provides a chapter dedicated to the optimization of JavaScript for execution speed, covering such topics as the minimization of I/O and DOM interaction and the simplification of loop conditions.

Part IV - Graphics and Multimedia Optimization provides a nice overview of web graphics formats (GIF, JPEG, and PNG), how to choose which format is best for a particular image, and how to choose between image quality and file size, along with tips such as combining images whenever possible to minimize the number of HTTP request required for each page. Photographic and image capturing techniques that help produce more easily optimized images such as taking pictures in as well lit an area as possible and making an effort to ensure that images are captured from a stable platform (by using a tripod, for example) are covered as well. King provides a similar treatment for multimedia, including both tips on how to best optimize files while maintaining the best possible quality and production techniques that help produce quality, optimization-friendly files from the outset. The final topic of this the section outlines PDF optimization techniques.

Part V - Search Engine Optimization is a brief overview of how to optimize your site for search engines. Covered are keyword selection techniques, how to optimize pages' markup for optimal search engine placement, and general site optimization techniques such as link building. Throughout the chapter, King outlines step-by-step the process he used to optimize the book's companion site, WebSiteOptimization.com, for search engine placement.

Part VI - Advanced Optimization Techniques explores server-side techniques for optimizing your site. The fist chapter of this section concerns itself with the optimization techniques that can be employed using SSI and URL rewriting. Among the topics covered are using mod_rewrite to abbreviate URLs and the use of the XBitHack to parse only those files that need it. The second chapter of this section provides a nice overview of compression, web compression technologies, and their practical use for web sites.

For further insight into the book's contents, a detailed table of contents, with summaries of each of the book's chapters and links to resources, can be accessed on the book's site.

Assessment

King's thoroughly researched book (it's copious footnotes and references are worth the price of the book alone) does an outstanding job of both providing an overview of web site optimization and outlining specific techniques that will increase your site's speed. Furthermore, the well organized book is an easy read and King's use of fun language, referring to Jeffrey Zeldman, Eric Costello, and Eric Meyer as "standards samurai" and noting that "(for many contemporary web sites) simple text navigation bars have been replaced by complex multi-image JavaScript-powered extravaganzas," makes the book flow even more.

While some of the techniques mentioned, such as reducing file names by a character or two, might seem almost too trivial to implement, especially if you're thinking about retroactively applying them to an existing site, the book's case studies demonstrate that these small optimizations can frequently lead to a noticeable overall improvement in a site's performance. The breadth of the techniques covered almost ensures that even very experienced web developers will come away from reading this book with a couple of new optimization techniques and a greater general understanding of how to best optimize sites.

While the most of the techniques mentioned in the book are no-brainers, some of the more extreme optimization techniques, such as conditionally including closing </td> tags for browsers that require them, involve time to verify that they are functioning correctly and introduce a level of server overhead that may not be justifiable given the comparatively modest reduction in file size that they offer. The problem here is that an inexperienced developer hell bent on trying to achieve maximum optimization might accidentally overdo things and damage a site's performance in unforeseen ways by creating a site that will overload its server or have pages that might break in certain browsers.

These objections, however, are minor, since this is a book on optimization after all, and King offers a broad selection of optimization methods from the simple and safe to those that are more complex, extreme, and not universally applicable. In King's defense, he does mention the caveats of the more debatable optimization techniques.

King also states in the introduction that the book is intended for intermediate and experienced developers, who should be able to determine whether or not a particular technique is suitable for any given site. I would, however, recommend this book to any developer, even those who are just now learning HTML, with the idea that King will dissuade them from acquiring poor habits.

Comments

Good review. Good book?

The review's great but I'm not so sure about the book from some of the things I've read here.

>"This section, like all of the following ones, ends with a case study, where King applies
>the book's techniques to a particular site, in this case PopularMechanics.com"

If that site's suppose to be optimized, I'd have to be honest and say that I don't think he has a clue about the topic his book's suppose to cover.

If you design sites well, you shouldn't need a book like this at all. If your content's accessible and your markup clean, logical, valid and properly separated from style, you shouldn't have any problems with speed, bandwidth or SE rankings.

>"More subtle techniques like defining style as high in the document tree as possible (i.e.,
>defining style for <body> instead of <p>) and segmenting JavaScript to allow you to load
>only that which is necessary for a particular platform as also covered."

Actually, defining style as high in the document tree as possible might actually hinder accessibility as it allows user defined sheets to style lower level elements however they want. This wouldn't be much of a problem with properties like font-size, but when you start applying color and background-color you may run into problems. For example, if you set the background-color of the body to black and text to white, and a user defined sheet set the color of paragraphs to black without specifying a contrasting background-color, they would see black text on a black background making the text illegible. The odds of this happening I am unsure of, but there's always a chance.

As for the second part of that quote, forget segmenting, you shouldn't be using platform specific script at all!

Anyway, like I already said, good review but I'm not so sure about the book itself.

The article is well written, maybe not the book...

The article is well written. The author of the book however, well, that dude is wearing blinders. Speeding up a web site at what cost??? The remark "conditionally including closing </td> tags for browsers that require them" is just amatuerish. Aside from the article writer's important point on that remark, It also prevents your site from passing XHTML compatibility which in turn may cause your site to be difficult or inaccessible to access by the visually impaired using screen readers. I bet the author did not know screen readers may read straight from standard editions of IE making them invisible to browser sensing. His kind of thinking will get people to remove the XHTML-required alt=" " tags on images that do not convey contentual value (images which are purely cosmetic or spacers.) The screen reader will then announce at every pass over one of those images "image" rather then passing over them silently. The author should understand that just because an element makes no visibile difference on the screen, it does not mean there is not a purpose for it.

Good book; it's what you do with it&#133;

This book was very useful to me. Although some are right to chide the author for including possibilities such as omitting quotation marks around attribute values, the book nevertheless made me think about lots of ways I might tighten up my markup practices. The author was good about putting it all out there, and giving pros and cons to most controversial techniques. The reader should feel free to pick and choose what s/he feels is good practice. I came away with a number of techniques of which I hadn't even given a first thought.

With widespread broadband- is this relevant?

The book teaches techniques that can speed up page load times by about 20%... highly noticeable on a 56kbps connection. But how many folks still use that? Even in developing countries like Thailand and the Philippines, surfers easily relish 2Mbps connection speeds at the local cafe. Rather than focusing on tweaking htm/css/xhtml for speed, people should agree on code that's more compatible across browsers. This way a site looks the same everywhere.

Joseph Plazo is recognized persuasion expert ... but can't persuade his business partners and clients to leave him alone.