The document discusses using YSlow, a web performance optimization tool, in a continuous integration (CI) workflow. It provides examples of running YSlow from the command line and integrating YSlow with a Node.js server to analyze HAR files from a CI system. Running YSlow as part of CI allows catching performance regressions earlier by comparing performance across branches. The best practice shown is combining real user monitoring (RUM) data with YSlow and other tools like WebPageTest to monitor production performance and catch issues.
42. 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
ydefault
Avoid Redirects
Remove Duplicate Scripts
(aka YSlow V2)
Configure ETags
Make AJAX Cacheable 23 rules
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
43. Minimize HTTP Requests
Use a Content Delivery Network
Add an Expires or a Cache-Control Header
Gzip Components
Put StyleSheets at the Top
Put Scripts at the Bottom
yslow1
Avoid CSS Expressions
Make JavaScript and CSS External
(aka YSlow V1/classic)
Reduce DNS Lookups
Minify JavaScript and CSS 13 rules
Avoid Redirects
Remove Duplicate Scripts
Configure ETags
44. Minimize HTTP Requests
Avoid empty src or href
Gzip Components
Put StyleSheets at the Top
Put Scripts at the Bottom
Avoid CSS Expressions yblog
Reduce DNS Lookups
Minify JavaScript and CSS
Avoid Redirects
(aka small site/blog)
Remove Duplicate Scripts
Reduce the Number of DOM Elements
15 rules
No 404s
Avoid Filters
Do Not Scale Images in HTML
Make favicon.ico Small and Cacheable
52. $ phantomjs yslow.js -i basic --format tap http://yslow.org
TAP version 13
1..1
ok 1 B (88) overall score
$ phantomjs yslow.js -i grade --format tap http://yslow.org
TAP version 13
1..24
ok 1 B (88) overall score
not ok 2 C (72) ynumreq: Make fewer HTTP requests
---
message: This page has 7 external Javascript scripts
...
ok 3 C (70) ycdn: Use a Content Delivery Network (CDN)
---
message: There are 3 static components not on CDN.
offenders:
- "yslow.org: 1 component, 8.0K (8.0K GZip)"
- "fonts.googleapis.com: 1 component, 1.0K (1.0K GZip)"
- "widgets.twimg.com: 1 component, 0.8K"
...
ok 4 A (100) yemptysrc: Avoid empty src or href
not ok 5 F (12) yexpires: Add Expires headers
---
message: There are 5 static components without a far-future expiration date.
offenders:
- "http://yslow.org/stylesheets/styles-min.css"
...