Yahoos Web Performance Guru: 14 Tenets for Speeding Up Sites - ' Another Trick' (
Page 2 of 2 )
: Controlling the Cache">
Another Trick: Controlling the Cache
Another trick is to configure your Web server to transmit image, CSS, and JavaScript files with an expiration header set far into the future. This tells the browser that instead of retaining the cached files for a few hours or days, it should retain them indefinitely. You're effectively telling the browser that these files will never change, and that it doesn't have to keep checking for fresh versions of them.
Of course, this is a lie—eventually, for instance, you probably will change your logo, your CSS font stylings, and your JavaScript. But since the browser identifies these components by Web address, you can make it load a new version by simply changing the filename or directory.
By applying a few of these simple rules, Souders' team was able to make a big impact on one of the most important sections of the Yahoo Web site—its search results page. "Within a year, we were able to improve response time by 40 to 50 percent," Souders says.
(Extra hint: To grade your Web site against Yahoo's rules, you can download an open source tool Yahoo has developed called YSlow. YSlow is actually an add-on to another Firefox browser extension called Firebug; together they provide a variety of tools for profiling and debugging Web sites and applications.)
Comments on this story? Write to its author, David Carr.