YSlow generates the page performance summaries by accessing the page components. As of today, browsers allow different levels of access to page components, which limits YSlow’s supported ruleset in each implementation.
The table below lists the supported rules by browser/platform.
|YSlow Rule||Firefox||Chrome||Mobile/Bookmarklet, Opera and Safari||Command Line (HAR)|
|Make fewer HTTP requests|
|Use a CDN|
|Avoid empty src or href|||
|Add Expires headers|
|Compress components with GZip|
|Put CSS at top|
|Avoid CSS expressions|
|Reduce DNS lookups|
|Avoid URL redirects|||
|Make AJAX cacheable|||||
|Use GET for AJAX requests|||||
|Reduce the number of DOM elements|||
|Avoid HTTP 404 (Not Found) error|
|Reduce cookie size|
|Use cookie-free domains|||
|Avoid AlphaImageLoader filter|
|Do not scale images in HTML|||
|Make favicon small and cacheable|||
- XHRs resolve any redirects on requests, it means when a request is made for url A that gets redirected to B that redirects to C, there's no trace of all redirects involved, thus this rule is never triggered.
- When scaning the page searching for components, XHRs can't be detected, hence these rules are not triggered.
- Only cookies sent over HTTP headers are considered and those components hosted in the same domain as the main page.
- Empty resources are not listed in HAR files.
- Since there's no real browser involved, a pseudo browser (JSDOM) is used to render the page which does not provide accurate results.
- No rendered image dimension information is available in HAR files. Inline and style background images can't be distinguished from regular images.
- Rule is only triggered when favicon is listed in exported HAR files.
Techniques Used to Access Page Components
It was the original implementation of YSlow and provides full access to page components information throught Firebug Net Panel. Since it's a add-on, Firefox allows cross domain access to iframes and CSS files hosted in different domains than the page domain.
Chrome extension API currently does not provide access to the netwok panel data, hence XHR requests are made for each component (script, css, images, etc) found on the page being analyzed. Cross domain XHRs are possible within Chrome extension sandbox environment.
Mobile/Bookmarklet, Opera and Safari
It relies on YQL as a proxy in order to get HTTP headers of page components, for all requests the user-agent string is passed to impersonate the browser making the request.
Command Line (HAR)
HAR files contain all HTTP headers information needed to YSlow analyze page performance, however since there's no real browser involved, some rules are not applicable.