Website Performance Best Practices by Yahoo!

YSlow is a free developer tool built by Yahoo engineers. YSlow analyses web pages across an array of metrics and gives a final grade. If you are conscious about the performance of a website, YSlow is your answer. Let’s talk a bit more about YSlow.


What is YSlow?

YSlow is a browser add-on that web developers and web masters can use to improve the performance of their website substantially. Although it doesn’t really do the changes that are required for you to improve your website performance, it does point out the grey areas, which itself is equally important to know.


What does YSlow do for you?

  • Grades web page based on one of three predefined rules
  • It offers suggestions for improving the page’s performance;
  • Summarizes the page’s components;
  • Displays statistics about the page;


The YSlow grade is from A all the way to F; with A being the best score achievable. Yahoo describes the rules of high performing web pages in their document here. Here is a screenshot outlining each of the 23 testable rules.

  • Minimize HTTP Requests
  • Use a Content Delivery Network
  • Avoid empty src or href
  • Add an Expires or a Cache-Control Header
  • Gzip Components
  • Put StyleSheets at the Top
  • Put Scripts at the Bottom
  • Avoid CSS Expressions
  • Make JavaScript and CSS External
  • Reduce DNS Lookups
  • Minify JavaScript and CSS
  • Avoid Redirects
  • Remove Duplicate Scripts
  • Configure ETags
  • Make AJAX Cacheable
  • Use GET for AJAX Requests
  • Reduce the Number of DOM Elements
  • No 404s
  • Reduce Cookie Size
  • Use Cookie-Free Domains for Components
  • Avoid Filters
  • Do Not Scale Images in HTML
  • Make favicon.ico Small and Cacheable


Discussing each and every rule is beyond the scope of this article; however, you would agree that most web developers and web masters are familiar with these 23 rules. The YSlow software uses an array of computational algorithms to calculate the final score taking into consideration each of these 23 rules, with each rule having a certain weighted point. You can take a look at the computational matrix here.


How do get YSlow?

Depending on which browser you are using, you can get YSlow from visiting its official page by clicking here. Since most people use Chrome, here is a quick tutorial on how to get it up and running on Chrome.

  1. Visit YSlow’s official website.
  2. Click the yellow Install YSlow button.
  3. It will take you to a Chrome extensions page.
  4. Once there, click the blue Add to Chrome button.
  5. After it has installed, you can see it in the right corner of your Google Chrome window.
  6. Now browse to the website/webpage you want YSlow to run on.
  7. Once there, click on the YSlow meter icon and then click the yellow Run test button.
  8. Now be patient while the YSlow does its magic.

Note: Run YSlow when the page has completely loaded to avoid discrepancies.

Website Performance Best Practices by Yahoo!

Here is an YSlow I ran for As expected, Grade A.

Website Performance Best Practices by Yahoo!

As a comparison, I ran an YSlow for the YSlow website itself. Again, Grade A.

Website Performance Best Practices by Yahoo!

However, Google scored +2 points due to it being much lighter and slightly well optimized. Now let’s try it for Facebook, which is a data intensive application. As you can see, Facebook scored Grade C with a 77 performance score. This is very low by its developer standards. I ran it on quite a few internet connections and ran it multiple times to avoid uncertainty and the score still comes around 77.

Website Performance Best Practices by Yahoo!

Let’s see what YSlow has to tell us about Facebook’s average performance score. Out of 23 rules, there are mostly As but 6 Fs. This is probably what has led to such an average score. Facebook got Fs on Fewer HTTP Requests, Use CDN, Add Expire Headers and Reduce DNS Lookups, Reduce Number of DOM lookups and Do Not scale images in HTML. Even though all of these are important, the most vital ones are using a CDN, scaling images in CSS rather than HTML and having fewer HTTP requests by minifying JS and CSS.


Why Should You Use YSlow?

If you feel you have worked really hard on a product, it is imperative that you would want many people to use it. This often means lots of concurrent connections and load on your server(s). YSlow helps you find out the grey areas so you can solve them, making your page faster, consuming lesser resources and putting a smile on your users’ faces by loading up your site lightning fast.

What are the things you should be looking to improve?

Here are the 11 things you should be looking to improve in your site:

  1. Minimize HTTP requests
  2. Use a Content Delivery Network
  3. Put CSS at top
  4. Put Scripts at bottom
  5. Avoid CSS expressions
  6. Don’t scale images in HTML
  7. Minify JS and CSS
  8. Make JS and CSS external
  9. Avoid Redirects
  10. No 404s
  11. Make items cacheable or small.