High Performance Web Sites

Mar 22

High Performance Web Sites

Steve Souders is Yahoo’s “front end engineer.” He’s the guy who wrote the article we discussed a few months back which brought us back to all those old “tricks” that make your Web site load faster.

Consider this: say your page takes 700 milliseconds to load from request to final render. As developers, we tend to obsess about the server-side time involved with this, but there’s a good chance that’s only, say, 300 milliseconds or so. This means over half the time is spent getting the page to the browser, and rendered in the browser. It’s this time which is a much juicier target for optimization than the back-end of the app.

But we tend to ignore this time. We tell ourselves how awesome we are that we can get a page “out the door” in 3/10ths of a second, meanwhile our users are sitting around waiting for four stylesheets and nine background images to load.

Souders rolls up his prior article and expands on it quite a bit to lay out 15 rules of good front-end engineering. Simple things like:

  1. Reduce HTTP requests
  2. Minify Javascript
  3. Add an Expires header
  4. etc.

The Expires header is interesting, and plainly obvious. You can make all your Javascript and CSS completely cacheable on the client, so that their browser doesn’t even ask for it from the server. Yes, we’ve all done If-Modified-Since headers, but even those force a GET request to ensure the target isn’t new.

Souders advises configuring the Expires header so the browser doesn’t even ask for the page. This isn’t new, but I’ve always been reluctant to do it because I feared that I couldn’t get the client to refresh their cache when I really need them to. The solution? Use your file names to “version” your Javascript and CSS to ensure the browser will refresh it when you need it to — when you have actually changed something. Did you ever wonder why all of Yahoo’s page components include the version number in their filename?

It’s a short book — less than 200 pages — and you could read it from cover-to-cover in an afternoon. In a way, it will bring you back to the days when we all had dial-up and we had to squeeze every last bit of performance out of our pages to avoid 10-second page loads, before the fat pipes of broadband made us all lazy.

Odds are that you could make a handful of changes to the front-end of your app that would be worth dozens of hours of re-engineering on the back-end to get your pages to render faster.


Comments

by duryodhan,   March 22, 2008 9:26 AM  

Two books in one day!?!

if only you had kept your Shelfari account, we could all have found it out without the blog posting! :D


by Dave,   March 22, 2008 11:11 PM  

Is Minify a real word?

As a non-developer, one of the things that bothers me is that when I'm reading most any blog from its main page, click a post to read any comments, then hit the back button to return to the main page, it's like many of the elements have to reload. Even if it's been two seconds since I left the main page, ads reload as well as many of the images. Is there a reason for that, or is it just me? (or is that addressed in your post, and it went right over my head?)


by Benjamin,   March 24, 2008 12:48 PM  

I can vouch for the virtues of Expire headers with far-off expiration dates. After using Yahoo!'s YSlow extension for Firebug, we realized that was the major pain point with the speed of our BlueInk CMS. Around that time we came across an article at ParticleTree's blog about "versioning" your CSS and JavaScript. We added that, gzip, and the Minify PHP library and got some massive speed improvements.

It was definitely worth the time.


by Chris Love,   July 5, 2008 11:46 AM  

This is a great book that every single web developer and designer should read. He is working on a sequel right now.



Add Comment


Want to advertise on this site? Contact FM.
Laser Toner Cartridges UK laser toner, toner cartridges, hp toner, lexmark toner, samsung toner, canon, toner, epson toner, oki toner, kyocera toner, xerox toner, remanufactured toner, compatible toner
Direct TV Deals Free 4 room direct tv deals. no equipment to buy. free fast professional direct tv installation. this is the best direct tv deal available anywhere.
SEO Article Learn from the experts with our SEO article.
rope light Shopping with birddog distributing, inc., gives you access to the lowest prices, the best customer service and the quickest delivery times possible.
Laptop AC Adapter We offer genuine factory direct replacement AC adapters.
Direct TV Best satellite TV deals.
Direct TV Deals Direct TV programming deals are varied and include packages containing from 50 channels up to over 250 channels.
8mm film to DVD Retain family memories with the only frame by frame digital restoration service in the United States for your 8mm film to DVD today
Rubber Stamp Shop for custom self-inking stamps, hand stamps, address stamps, label stamps, check endorsement stamps, check deposit stamps, date stamps, pre inks, pocket stamps, ink and much more!