Sean Corfield

Improve Site Performance With YSlow

By: Sean Corfield

June 27th, 2007 · No Comments

If you haven’t already heard, Yahoo! has released YSlow for Firebug, a Firefox plugin that analyzes your site for ways to speed things up in terms of HTML, CSS and JavaScript.

I installed it an hour ago and it gave my site a performance grade of D with a score in the low 60’s. After a few small tweaks, my grade is B and my score is 83. My blog should be noticeably faster to load.

The first thing it recommended I do (an “F” on Reduce DNS lookups) was to strip a number of the third-party JavaScript features I’d added over time in order to reduce the number of domains my site referenced. I removed the Technorati, Skype and Twitter JS calls because, well, they really don’t add much value. I changed my Site Meter code to use the non-JavaScript version - which also had the benefit of removing attempts to ping specificclick.net which sets a third-party tracking cookie (Google for more details - some people feel Site Meter should have been more open about this change).

I also got an “F” for ETags. Reading the Yahoo! site (linked from the YSlow plugin) gave me the Apache magic necessary to disable those (in my .htaccess file):

FileETag none

I have a “B” now because the Developer Circuit widget still has an ETag.

An “F” in Expires header scoring became a “D” after I enabled Expires headers for CSS and images (again, in .htaccess):

ExpiresActive On

ExpiresByType text/css “access plus 1 month”

ExpiresByType image/jpeg “access plus 1 month”

ExpiresByType image/gif “access plus 1 month”

My Gzip components scored improved to a “B” by adding a directive to deflate CSS:

AddOutputFilterByType DEFLATE text/css

Another tweak I made that seemed to help was adding defer=”defer” to the Developer Circuit JavaScript include - the only third-party JS left on my site now.

The only remaining “red flag” - my one remaining “F” - is the recommendation to use a CDN which isn’t really available for free to folks like you and me.

If Developer Circuit adds a few Expires headers, enables Gzip and disables ETags then my site will get faster still but I’m impressed with what I’ve been able to do in a short space of time.

Thanx Yahoo!

p.s. Also thanx to John Farrar who was the first person to notify me about YSlow!

Tags: Uncategorized

About The Author

Sean is currently Senior Computer Scientist and Team Lead in the Hosted Services group at Adobe Systems Incorporated. He has worked in the IT industry for nearly twenty-five years, first in database systems and compilers (serving eight years on the ANSI C++ Standards Committee), then in mobile telecoms, and finally in web development. Sean is a staunch advocate of software standards and best practices, and is a well-known and respected speaker on these subjects. Sean has championed and contributed to a number of ColdFusion frameworks, and is a frequent publisher on his blog, http://corfield.org/

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment