YSlow User Guide

Introduction

YSlow analyzes web page performance by examining all the components on the page, including components dynamically created by using JavaScript. It measures the page's performance and offers suggestions for improvement.

YSlow for Firefox is integrated into the Firebug web development tool for Firefox.

[Note] Note

YSlow is not integrated into Firebug Lite for Internet Explorer yet.

Performance Rules

Yahoo!'s Exceptional Performance team has identified 34 rules that affect web page performance. YSlow's web page analysis is based on the 23 of these 34 rules that are testable. These testable rules are listed below roughly in order of importance and effectiveness. Studies have shown that web page response time can be improved by 25% to 50% by following these rules.

  1. Minimize HTTP Requests
  2. Use a Content Delivery Network
  3. Avoid empty src or href
  4. Add an Expires or a Cache-Control Header
  5. Gzip Components
  6. Put StyleSheets at the Top
  7. Put Scripts at the Bottom
  8. Avoid CSS Expressions
  9. Make JavaScript and CSS External
  10. Reduce DNS Lookups
  11. Minify JavaScript and CSS
  12. Avoid Redirects
  13. Remove Duplicate Scripts
  14. Configure ETags
  15. Make AJAX Cacheable
  16. Use GET for AJAX Requests
  17. Reduce the Number of DOM Elements
  18. No 404s
  19. Reduce Cookie Size
  20. Use Cookie-Free Domains for Components
  21. Avoid Filters
  22. Do Not Scale Images in HTML
  23. Make favicon.ico Small and Cacheable

When analyzing a web page, YSlow deducts points for each infraction of a rule and then applies a grade to each rule. An overall grade and score for the web page is computed by summing up the values of the score for each rule weighted by the rule's importance. Note that the rules are weighted for an average page. For various reasons, there may be some rules that are less important for your particular page.

From YSlow 2.0 on, users can create their own custom rulesets in addition to the following three predefined rulesets:

  1. YSlow(V2) - this ruleset contains the 23 rules listed above.
  2. Classic(V1) - this ruleset contains the first 13 rules listed above.
  3. Small Site or Blog - this ruleset contains 14 rules that are applicable to small web sites or blogs.

Refer to Customizing Rulesets for more information.

Installing YSlow

YSlow for Firefox needs Firebug to run. Obtain the latest version of Firebug from https://addons.mozilla.org/en-US/firefox/addon/1843. Firebug documentation is available at http://www.getfirebug.com/docs.html.

Once Firebug is installed, download YSlow for Firefox from https://addons.mozilla.org/en-US/firefox/addon/5369. Follow the prompts to install the tool.

Using YSlow

YSlow for Firefox runs in the Firebug window, so in order to run the tool, Firebug must be enabled.

There are two ways to start YSlow for Firefox:

  1. Open the Firebug window and click on the YSlow tab.
  2. Click the YSlow button on the status bar.


The first time you bring up Firefox with YSlow, the following screen will be displayed in the Firebug portion of the browser window:

yslow initial page

Click Run Test to run YSlow. You may also click on the Grade, Components, or Statistics tabs to start the web page analysis.

You can click on the box next to Autorun YSlow each time a web page is loaded to set up YSlow to run each time the browser loads a web page. You can enable or disable the Autorun option by right clicking anywhere in the YSlow status bar and selecting or deselecting Autorun.

If you left click on the YSlow icon on the left side of the status bar or the response time value on the right side, the page display will toggle between displaying the entire page and displaying the page with the Firebug window. If you left click on the grade in the status bar, the Grade View will be displayed in the Firebug window. If you left click on the page weight value in the status bar, the Statistics View will be displayed in the Firebug window.

Contact Us

YSlow development is discussed in the Exceptional Performance group.