Fork me on GitHub

YSlow Ruleset Matrix

YSlow analyzes web pages and why they're slow based on Yahoo!'s rules for high performance web sites

Matrix Table Keys

  1. Rule: The YSlow performance rule
  2. Weight: How this performance rule is weighted in the overall page analyis grade
  3. Points: Number of points deducted per offender (performance infraction occurance), from a total of 100 per rule
  4. Configs: How many points/threshold per component will be used for computation
  5. Score Computation: The formula used to compute the final score per rule
  6. Grades from A to F: How many components/offenders is necessary to reach grades from A to F

Download PDF version

Rule Weight Points Configs Score Computation (A)
90 <= S <= 100
(B)
80 <= S < 90
(C)
70 <= S < 80
(D)
60 <= S < 70
(E)
50 <= S < 60
(F)
0 <= S < 50
Make fewer HTTP requests 8 js = 3
css = 4
css images = 3
max js = 3
max css = 2
max css images = 6
(N JS - 3) * 3
(N CSS - 2) * 4
(N CSS images - 6) * 3
0 to 6 JS OR
0 to 4 CSS OR
0 to 9 CSS images
7 to 9 JS OR
5 to 7 CSS OR
10 to 12 CSS images
10 to 13 JS OR
8 to 9 CSS OR
13 to 16 CSS images
14 to 16 JS OR
10 to 12 CSS OR
17 to 19 CSS images
17 to 19 JS OR
13 to 14 CSS OR
20 to 22 CSS images
>= 20 JS OR
>= 15 CSS OR
>= 23 CSS images
Use a CDN 6 10 patterns = CDN hostname RegExp patterns
types = js, css, image, cssimage, flash, favicon
N RegExp mismatches * 10
(ignores /favicon.ico)
0 or 1 of any type 2 of any type 3 of any type 4 of any type 5 of any type >= 6 of any type
Avoid empty src or href 30 100 - N empty src <img> * 100
N empty src <script> * 100
N empty href <link rel="stylesheet"> * 100
0 empty src <img> AND
0 empty src <script> AND
0 empty href <link rel="stylesheet">
- - - - >= 1 empty src <img> OR
>= 1 empty src <script> OR
>= 1 empty href <link rel="stylesheet">
Add Expires headers 10 11 how far = 172800s (2 days)
types = js, css, image, cssimage, flash, favicon
N (unexpired or expiring in < 2 days of any type) * 11 0 unexpired or expiring in < 2 days of any type 1 unexpired or expiring in < 2 days of any type 2 unexpired or expiring in < 2 days of any type 3 unexpired or expiring in < 2 days of any type 4 unexpired or expiring in < 2 days of any type >= 5 unexpired or expiring in < 2 days of any type
Compress components with GZip 8 11 min file size = 500 bytes
types = doc, iframe, xhr, js, css
N (uncompressed or file size < 500b of any type) * 11 0 uncompressed or file size < 500b of any type 1 uncompressed or file size < 500b of any type 2 uncompressed or file size < 500b of any type 3 uncompressed or file size < 500b of any type 4 uncompressed or file size < 500b of any type >= 5 uncompressed or file size < 500b of any type
Put CSS at top 4 10 - 1 + N CSS link tag on BODY * 10 0 CSS link tag on BODY 1 CSS link tag on BODY 2 CSS link tag on BODY 3 CSS link tag on BODY 4 CSS link tag on BODY >= 5 CSS link tag on BODY
Put JavaScript at bottom 4 5 - N JS on HEAD * 5
ignores injected, defered and async JS
0 to 2 JS on HEAD 3 or 4 JS on HEAD 5 or 6 JS on HEAD 7 or 8 JS on HEAD 9 or 10 JS on HEAD >= 11 JS on HEAD
Avoid CSS expressions 3 2 - N expressions on CSS links or inline STYLE * 2 0 to 5 expressions on CSS or inline STYLE 6 to 10 expressions on CSS or inline STYLE 11 to 15 expressions on CSS or inline STYLE 16 to 20 expressions on CSS or inline STYLE 21 to 25 expressions on CSS or inline STYLE >= 26 expressions on CSS or inline STYLE
Make JavaScript and CSS external 4 n/a - none - - - - - -
Reduce DNS lookups 3 5 max domains = 4 N domains > 4 AND
(N domains - 4) * 5
0 to 6 domains 7 or 8 domains 9 or 10 domains 11 or 12 domains 13 or 14 domains >= 15 domains
Minify JavaScript and CSS 4 10 types = js, css N (unminified JS or CSS external or inline) * 10 0 or 1 unminified component 2 unminified components 3 unminified components 4 unminified components 5 unminified components >= 6 unminified components
Avoid URL redirects 4 10 - N redirects * 10 0 or 1 redirect 2 redirects 3 redirects 4 redirects 5 redirects >= 6 redirects
Remove duplicate JavaScript and CSS 4 5 types = js, css N (duplicated JS or CSS) * 5 0 to 2 duplicated JS or CSS 3 or 4 duplicated JS or CSS 5 or 6 duplicated JS or CSS 7 or 8 duplicated JS or CSS 9 or 10 duplicated JS or CSS >= 11 duplicated JS or CSS
Configure ETags 2 11 types = js, css, image, cssimage, flash, favicon N bad etag of any type * 11 0 bad etag of any type 1 bad etag of any type 2 bad etags of any type 3 bad etags of any type 4 bad etags of any type >= 5 bad etags of any type
Make AJAX cacheable 4 5 min cache time = 3600s N (uncached or expiring in < 3600s) XHR * 5 0 to 2 uncacheable XHR 3 or 4 uncacheable XHR 5 or 6 uncacheable XHR 7 or 8 uncacheable XHR 9 or 10 uncacheable XHR >= 11 uncacheable XHR
Use GET for AJAX requests 3 5 - N XHRs not using GET * 5 0 to 2 XHRs not using GET 3 or 4 XHRs not using GET 5 or 6 XHRs not using GET 7 or 8 XHRs not using GET 9 or 10 XHRs not using GET >= 11 XHRs not using GET
Reduce the number of DOM elements 3 10 range = 250
max dom = 900
N DOM elements > 900 AND
(N DOM elements - 900) / 250 * 10
0 to 1150 DOM elements 1151 to 1400 DOM elements 1401 to 1650 DOM elements 1651 to 1900 DOM elements 1901 to 2150 DOM elements >= 2151 DOM elements
Avoid HTTP 404 (Not Found) error 4 5 types = js, css, image, cssimage, flash, favicon, xhr N 404 * 5 0 to 2 404 3 or 4 404 5 or 6 404 7 or 8 404 9 or 10 404 >= 11 404
Reduce cookie size 3 10 max cookie size = 1000 cookie size > 1000 AND
1 + (cookie size / 1000) * 10
0 to 1000 bytes cookies 1001 to 1900 bytes cookies 1901 to 2900 bytes cookies 2901 to 3900 bytes cookies 3901 to 4900 bytes cookies >= 4901 bytes cookies
Use cookie-free domains 3 5 types = js, css, image, cssimage, flash, favicon N (components of any type with cookies of any size) * 5
ignores /favicon.ico
0 to 2 components with cookie 3 or 4 components with cookie 5 or 6 components with cookie 7 or 8 components with cookie 9 or 10 components with cookie >= 11 components with cookie
Avoid AlphaImageLoader filter 4 5 half points = 2 N alpha filters * 5 + M _hack alpha filters * 2 0 to 2 alpha filters OR
0 to 5 _hack alpha filters
3 or 4 alpha filters OR
6 to 10 _hack alpha filters
5 or 6 alpha filters OR
11 to 15 _hack alpha filters
7 or 8 alpha filters OR
16 to 20 _hack alpha filters
9 or 10 alpha filters OR
21 to 25 _hack alpha filters
>= 11 alpha filters OR
>= 26 _hack alpha filters
Do not scale images in HTML 3 5 - N (images scaled down width or height) * 5 0 to 2 scaled down images 3 or 4 scaled down images 5 or 6 scaled down images 7 or 8 scaled down images 9 or 10 scaled down images >= 11 scaled down images
Make favicon small and cacheable 2 5 size = 2000b
min cache time = 3600s
Favicon 404 not found = 5
Favicon size > 2000b = 5
No favicon expiration or expiration < 3600s = 5
Favicon is found AND
Any favicon size
Any expiration or not
OR
Favicon is not found AND
Any expiration or not (usually not)
- - - - -