Tips for Getting Exceptional Performance for Your Site

Yahoo is sharing the love with the development community by offering up a plugin for Firefox and a list of tips to speed up sites. The plugin is cleverly named YSlow and is actually an add-on for the marvelous Firebug. It gives you a new tab in Firebug that shows you performance, stats, and components. The performance tab gives your site’s page a letter grade based on 13 rules for optimizing download times. Each rule gets a grade and has a link to the Yahoo site explaining the improvements that could be made.

Among the potential improvements is Gzipping components. For those not familiar with Gzip, it’s a compression method Apache web server uses to squeeze your text-based files into smaller packages so that there’s less data to transfer to the browser. Typical javascript and css files will be sent at 25-50% of their file size. (e.g. if you have a 6k css file and you ask Apache to Gzip it before it sends it, the browser will only have to wait for a 2-3k file.) It may not seem like a big deal when viewed in the context of one browser making one request but, when you multiply that by thousands of users making many requests, the bandwidth and time savings become very tangible.

The other improvement that isn’t self-explanatory is minifying javascript files. Essentially, javascript files have line-breaks and extra spaces for human legibility and these cause extra bytes to be added to the total file size. However, computers can read the syntax without the white space. So, by running the finished javascript through a little tool like JS Minifier you can reduce the download size to 50-75% of the original. Again, we apply the same logic as above regarding the exponential savings with more users and requests.

The last rule says “Configure ETags” and although I’ve read Yahoo’s entry explaining it, I haven’t managed to implement it. So, if you’ve got advice or tips regarding ETags (or anything else concerning performance optimization) please share!

Leave a Reply

Your email address will not be published. Required fields are marked *