Submit Your Article
Home Articles News Tutorials Videos Add An Article
Topics: Design Photoshop Programming PHP CSS Java Database Web Development Javascript Ajax
– Close + Open

Find Out More About DevWebPro!

Sign up for the newsletter


» Terms & Conditions

Welcome to the New DevWebPro!

DevWebPro Includes:
  Hundreds Of Tutorials   Developer News
  Unique Gadget Videos   Tons of Topics to Discuss
  Expert Advice   We Will Publish Your Articles

Improve Site Performance With YSlow

By: Sean Corfield
Wednesday, June 27th, 2007
Text: Decrease Font Size Increase Font Size | Print Print Article | Share: Delicious Digg StumbleUpon Post to Twitter Post to Facebook

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!

Topics:

About the Author:
Sean is currently Chief Technology Officer for Railo Technologies US. He has worked in IT for over twenty five years, starting out writing database systems and compilers then moving into mobile telecoms and finally into web development in 1997. Along the way, he worked on the ISO and ANSI C++ Standards committees for eight years and is a staunch advocate of software standards and best practice. Sean has championed and contributed to a number of CFML frameworks and was lead developer on Fusebox for two years.
DevWebPro is an iEntry Network ® publication - © 1998-2010 All Rights Reserved