SlideShare a Scribd company logo
After YSlow “A”: 20 more ideas for improving the user experience Nicole Sullivan nicolesl@yahoo-inc.com  http://www.stubbornella.org Stoyan Stefanov stoyan@yahoo-inc.com  http://www.phpied.com  http://developer.yahoo.com/performance
The sluggish Web 500 ms slower = 20% drop in traffic (Google) 400ms slower = 5-9% drop in full-page traffic (Yahoo!) * 100 ms slower = 1% drop in sales (Amazon) * Users leaving before the page finishes loading
Exceptional Performance at Yahoo! Quantify and improve the performance of all Yahoo! products worldwide Center of expertise Build tools, analyze data Gather, research, and evangelize best practices - internally and externally YSlow
 
The Performance Golden Rule 80-90% of the end-user response time is spent on the front-end.  Start there. Greater potential for improvement Simpler Proven to work
List of 14 best practices  (updated) Make Fewer HTTP Requests Use a Content Delivery Network Add Expires header  (or Cache-control) Gzip Components Put CSS at the Top Move Scripts to the Bottom  (inline too) Avoid CSS Expressions Make JavaScript and CSS External Reduce DNS Lookups Minify JavaScript  and CSS (inline too) Avoid Redirects Remove Duplicate Scripts Configure ETags Make AJAX Cacheable http://developer.yahoo.com/performance/rules.html   content server server server server javascript javascript javascript javascript content css css css css content content
After YSlow “A”: 20 more best practices
After YSlow "A"?
After YSlow "A"?
tag:  server
Flush the buffer early Let the browser start fetching components while your backend is busy PHP function  <?php flush(); ?> Best for busy backends / light frontends Case Study: Yahoo! Search Components download in parallel with HTML
tag:  content
Post-load components Ask yourself: what's  absolutely required  in order to render the page initially? The rest can wait (drag and drop, animations, hidden content, images below the fold) JavaScript is ideal candidate for splitting YUI Image Loader YUI Get Utility
Post-load components onload.js and onload.css Progressive enhancement Case study: yahoo.com
Preload components Preload items you'll need in the future: Unconditional  preload (google.com loads a sprite onload) Conditional  preload (search.yahoo.com after you type in the input box) Anticipated  preload – preload in advance before launching a redesign
Preload - Unconditional Example:
Preload - Conditional Example: search.yahoo.com
Preload - Anticipated “ The  redesign is cool , but it’s  so slow!” Of course it’s slow:  100% of page views are with an empty cache.  New Feature or full redesign? Preload components before launch;  users will already have a primed cache when you go live.
Reduce DOM elements World's fastest page?  about:blank ! Risks: More bytes to download Slower DOM access in JavaScript Semantically incorrect markup (like nested tables or abusing  <div> s)
Reduce DOM elements Recommendations: Use semantic markup Use YUI's reset.css, fonts.css, grids.css Easy to test, just type in Firebug’s console: document.getElementsByTagName('*').length yahoo.com is a busy page and  still under 700 HTML elements
tag:   javascript
Develop smart event handlers
tag:   css
Avoid filters – AlphaImageLoader Why is the AlphaImageLoader used? IE6 and earlier don’t natively support alpha transparency.  This filter forces that support. Problems: Blocks rendering, freezes the browser Increased memory consumption  Per element, not per image!
Avoid AlphaImageLoader Best Solution: Avoid completely,  use gracefully degrading PNG8.  Fallback: use underscore hack so as not to penalize IE7+ users. _filter
Avoid filters Yahoo! Search saved  50-100ms  for users of IE5&6
tag:   images
Hmm, images? Q: Is this really important? A: Let’s survey the    global top 10 sites.
What % of page weight is images? Average  45.6% 1 Yahoo! 29% 2 Google 75% 3 YouTube 62% 4 Live.com 64% 5 MSN 41% 6 MySpace 48% 7 Wikipedia 39% 8 Facebook 35% 9 Blogger 27% 10 Yahoo! JP 36%
GIF-to-PNG Average  20.42% savings LOSSLESS!
Crush PNG Average  16.05% savings LOSSLESS!
Strip JPEG metadata Average  11.85% savings LOSSLESS!
Optimize images Convert all GIFs to PNGs (and check if there’s a saving)   > convert image.gif image.png Crush all PNGs   > pngcrush image.png –rem alla –reduce result.png Strip comments from JPEGs  > jpegtran -copy none -optimize -perfect src.jpg dest.jpg
Case study: Google charts API 1 2 3
Case study: Google charts API 1 2 3 Original (707 colors)
Case study: Google charts API Original (1408 colors) Crushed (1408 colors) PNG8 (256 colors) 25% saving 55% saving (1000+ colors are lost but who can tell?)
Optimize images All sites can optimize images Which (former) presidential candidate had over 200K of useless image information sent over the wire for a single page?!
Optimize CSS sprites Combine similar colors  Keep color count low (<256) to fit in a PNG8 “ Be mobile-friendly” – don’t leave big gaps
Optimize sprites Horizontal may be smaller
To sprite or not to sprite?  1.  How many  pages  does your property have? 2.  Is your site  modular ? (hint: it should be!) 3.  How much   time   can your team spend on site  maintenance?
tag:   mobile
Mobile Performance Research Reduce the size of each component to   25 Kb  or less. http://yuiblog.com/blog/2008/02/06/iphone-cacheability/ iPhone
URLs – Exceptional Performance YUI blog  http://yuiblog.com/blog/category/performance/   YDN (Yahoo Developer Network)  http://developer.yahoo.com/performance/   YDN blog http://developer.yahoo.net/blog/archives/performance/   Mailing list (Yahoo! Group) http://tech.groups.yahoo.com/group/exceptional-performance/   Feedback http://developer.yahoo.com/yslow/feedback.html
URLs (contd.) &quot;When the Cookie Crumbles&quot; Tenni Theurer, Steve Souders http://yuiblog.com/blog/2007/03/01/performance-research-part-3/ &quot;Maximizing Parallel Downloads in the Carpool Lane&quot;, Tenni Theurer, Patty Chi http://yuiblog.com/blog/2007/04/11/performance-research-part-4/ YUI Image Loader ( http://developer.yahoo.com/yui/imageloader/ ) YUI Get ( http://developer.yahoo.com/yui/get/ ) YUI Compressor ( http://developer.yahoo.com/yui/compressor/  contains a Java port of an internal PHP CSS minifier tool written by Isaac Schlueter,  http://foohack.com/ ) JSMin ( http://www.crockford.com/javascript/jsmin.html ) &quot;High-performance AJAX applications&quot; Julien Lecompte  http://yuiblog.com/blog/2007/12/20/video-lecomte/ Yahoo! engineer Michael J. Radwin talk back in 2004 http://www.radwin.org/michael/talks/
Credits – thank you!
Take-home Focus on the front-end Optimize images Be relentlessly user focused Every feature has a cost Start early!
Thank you! Nicole Sullivan nicolesl@yahoo-inc.com  http://www.stubbornella.org Stoyan Stefanov stoyan@yahoo-inc.com  http://www.phpied.com  http://developer.yahoo.com/performance

More Related Content

PDF
7 Habits of Exceptional Performance
PDF
Design Fast Websites
PDF
Performance as UX with Justin Howlett
PDF
Going Fast on the Mobile Web
PPTX
Imagesandvideo tallinn
PPTX
Imagesandvideo stockholm webmeetup
PPTX
High Performance Mobile Web
PPTX
Imagesandvideo stockholm fastandbeautiful
7 Habits of Exceptional Performance
Design Fast Websites
Performance as UX with Justin Howlett
Going Fast on the Mobile Web
Imagesandvideo tallinn
Imagesandvideo stockholm webmeetup
High Performance Mobile Web
Imagesandvideo stockholm fastandbeautiful

What's hot (20)

PDF
Mobile Web Speed Bumps
PDF
Measuring Web Performance (HighEdWeb FL Edition)
PDF
High Performance Web Design
PDF
Expanding XPages with Bootstrap Plugins for Ultimate Usability
ZIP
Improving Drupal's Page Loading Performance
PDF
State of jQuery '09
PPT
Optimizing Sites for Mobile Devices
PDF
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
PPTX
Quantifying The Mobile Difference
POTX
Its timetostopstalling limerick
PDF
High Performance Web - Full Stack Toronto
POTX
Mobile App Performance, Dublin MOT
PDF
Improving frontend performance
PDF
Web Performance & You - HighEdWeb Arkansas Version
KEY
Developing High Performance Web Apps - CodeMash 2011
PDF
Happy Browser, Happy User! NY Web Performance Meetup 9/20/19
PDF
Performance.now() fast but not furious
PDF
Mobile Web Best Practices
PDF
There Are No “Buts” in Progressive Enhancement [Øredev 2015]
PDF
That's Web? Extreme Optimization for the Mobile Web (Oct 2012)
Mobile Web Speed Bumps
Measuring Web Performance (HighEdWeb FL Edition)
High Performance Web Design
Expanding XPages with Bootstrap Plugins for Ultimate Usability
Improving Drupal's Page Loading Performance
State of jQuery '09
Optimizing Sites for Mobile Devices
Raiders of the Fast Start: Frontend Performance Archaeology - Performance.now...
Quantifying The Mobile Difference
Its timetostopstalling limerick
High Performance Web - Full Stack Toronto
Mobile App Performance, Dublin MOT
Improving frontend performance
Web Performance & You - HighEdWeb Arkansas Version
Developing High Performance Web Apps - CodeMash 2011
Happy Browser, Happy User! NY Web Performance Meetup 9/20/19
Performance.now() fast but not furious
Mobile Web Best Practices
There Are No “Buts” in Progressive Enhancement [Øredev 2015]
That's Web? Extreme Optimization for the Mobile Web (Oct 2012)
Ad

Viewers also liked (20)

PDF
Building the Media Block in ReactJS
PDF
Creating Living Style Guides to Improve Performance
KEY
Object Oriented CSS
PDF
Pourquoi la performance?
PDF
CSS Bloat!
KEY
What is Object Oriented CSS?
KEY
The Fast And The Fabulous
PDF
CSS Power Tools
PDF
Don't feed the trolls
KEY
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
PDF
Our Best Practices Are Killing Us
KEY
Taming CSS Selectors
KEY
CSS Wish List @JSConf
PDF
Why are you here?
PDF
Specialise or cross-skill
PDF
CSS: a rapidly changing world
PDF
CSS Best practice
PDF
5 Mistakes of Massive CSS
PDF
Creating a Simple, Accessible On/Off Switch
PDF
CSS3 - is everything we used to do wrong?
Building the Media Block in ReactJS
Creating Living Style Guides to Improve Performance
Object Oriented CSS
Pourquoi la performance?
CSS Bloat!
What is Object Oriented CSS?
The Fast And The Fabulous
CSS Power Tools
Don't feed the trolls
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
Our Best Practices Are Killing Us
Taming CSS Selectors
CSS Wish List @JSConf
Why are you here?
Specialise or cross-skill
CSS: a rapidly changing world
CSS Best practice
5 Mistakes of Massive CSS
Creating a Simple, Accessible On/Off Switch
CSS3 - is everything we used to do wrong?
Ad

Similar to After YSlow "A" (20)

PPT
Csdn Drdobbs Tenni Theurer Yahoo
PPT
Os Souders
PPT
Yahoo - Web Images optimization
PDF
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
PDF
Open-source website performance tools
PPT
Windy cityrails performance_tuning
PPT
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
PDF
10 tips to improve the usability of Joomla - Joomla World Conference 2014
PDF
WordPress SEO in 2014 - WordCamp Baltimore 2014
PPTX
SearchLove Boston 2018 - Bartosz Goralewicz - JavaScript: Looking Past the ...
PDF
Search Engines and Flash: Secrets, Tricks, and Black Magic
PPTX
Flash SEO Secrets
PDF
Deep crawl the chaotic landscape of JavaScript
PPT
腾讯大讲堂09 如何建设高性能网站
PPT
腾讯大讲堂09 如何建设高性能网站
PPTX
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...
PDF
Web browsers and browser version support
PPT
Images - 7 mistakes (first draft)
PDF
The need for Speed: Advanced #webperf - SEOday 2018
PPT
腾讯大讲堂09 如何建设高性能网站
Csdn Drdobbs Tenni Theurer Yahoo
Os Souders
Yahoo - Web Images optimization
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)
Open-source website performance tools
Windy cityrails performance_tuning
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
10 tips to improve the usability of Joomla - Joomla World Conference 2014
WordPress SEO in 2014 - WordCamp Baltimore 2014
SearchLove Boston 2018 - Bartosz Goralewicz - JavaScript: Looking Past the ...
Search Engines and Flash: Secrets, Tricks, and Black Magic
Flash SEO Secrets
Deep crawl the chaotic landscape of JavaScript
腾讯大讲堂09 如何建设高性能网站
腾讯大讲堂09 如何建设高性能网站
Educate 2017: Quick 'n Lazy: How we keep things speedy while staying out of y...
Web browsers and browser version support
Images - 7 mistakes (first draft)
The need for Speed: Advanced #webperf - SEOday 2018
腾讯大讲堂09 如何建设高性能网站

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation theory and applications.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Cloud computing and distributed systems.
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Understanding_Digital_Forensics_Presentation.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Review of recent advances in non-invasive hemoglobin estimation
Approach and Philosophy of On baking technology
Encapsulation theory and applications.pdf
cuic standard and advanced reporting.pdf
NewMind AI Weekly Chronicles - August'25 Week I
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Cloud computing and distributed systems.
Chapter 3 Spatial Domain Image Processing.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Reach Out and Touch Someone: Haptics and Empathic Computing
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Machine learning based COVID-19 study performance prediction
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Modernizing your data center with Dell and AMD
Encapsulation_ Review paper, used for researhc scholars
Understanding_Digital_Forensics_Presentation.pptx

After YSlow "A"

  • 1. After YSlow “A”: 20 more ideas for improving the user experience Nicole Sullivan nicolesl@yahoo-inc.com http://www.stubbornella.org Stoyan Stefanov stoyan@yahoo-inc.com http://www.phpied.com http://developer.yahoo.com/performance
  • 2. The sluggish Web 500 ms slower = 20% drop in traffic (Google) 400ms slower = 5-9% drop in full-page traffic (Yahoo!) * 100 ms slower = 1% drop in sales (Amazon) * Users leaving before the page finishes loading
  • 3. Exceptional Performance at Yahoo! Quantify and improve the performance of all Yahoo! products worldwide Center of expertise Build tools, analyze data Gather, research, and evangelize best practices - internally and externally YSlow
  • 4.  
  • 5. The Performance Golden Rule 80-90% of the end-user response time is spent on the front-end. Start there. Greater potential for improvement Simpler Proven to work
  • 6. List of 14 best practices (updated) Make Fewer HTTP Requests Use a Content Delivery Network Add Expires header (or Cache-control) Gzip Components Put CSS at the Top Move Scripts to the Bottom (inline too) Avoid CSS Expressions Make JavaScript and CSS External Reduce DNS Lookups Minify JavaScript and CSS (inline too) Avoid Redirects Remove Duplicate Scripts Configure ETags Make AJAX Cacheable http://developer.yahoo.com/performance/rules.html content server server server server javascript javascript javascript javascript content css css css css content content
  • 7. After YSlow “A”: 20 more best practices
  • 11. Flush the buffer early Let the browser start fetching components while your backend is busy PHP function <?php flush(); ?> Best for busy backends / light frontends Case Study: Yahoo! Search Components download in parallel with HTML
  • 13. Post-load components Ask yourself: what's absolutely required in order to render the page initially? The rest can wait (drag and drop, animations, hidden content, images below the fold) JavaScript is ideal candidate for splitting YUI Image Loader YUI Get Utility
  • 14. Post-load components onload.js and onload.css Progressive enhancement Case study: yahoo.com
  • 15. Preload components Preload items you'll need in the future: Unconditional preload (google.com loads a sprite onload) Conditional preload (search.yahoo.com after you type in the input box) Anticipated preload – preload in advance before launching a redesign
  • 17. Preload - Conditional Example: search.yahoo.com
  • 18. Preload - Anticipated “ The redesign is cool , but it’s so slow!” Of course it’s slow: 100% of page views are with an empty cache. New Feature or full redesign? Preload components before launch; users will already have a primed cache when you go live.
  • 19. Reduce DOM elements World's fastest page? about:blank ! Risks: More bytes to download Slower DOM access in JavaScript Semantically incorrect markup (like nested tables or abusing <div> s)
  • 20. Reduce DOM elements Recommendations: Use semantic markup Use YUI's reset.css, fonts.css, grids.css Easy to test, just type in Firebug’s console: document.getElementsByTagName('*').length yahoo.com is a busy page and still under 700 HTML elements
  • 21. tag: javascript
  • 23. tag: css
  • 24. Avoid filters – AlphaImageLoader Why is the AlphaImageLoader used? IE6 and earlier don’t natively support alpha transparency. This filter forces that support. Problems: Blocks rendering, freezes the browser Increased memory consumption Per element, not per image!
  • 25. Avoid AlphaImageLoader Best Solution: Avoid completely, use gracefully degrading PNG8. Fallback: use underscore hack so as not to penalize IE7+ users. _filter
  • 26. Avoid filters Yahoo! Search saved 50-100ms for users of IE5&6
  • 27. tag: images
  • 28. Hmm, images? Q: Is this really important? A: Let’s survey the global top 10 sites.
  • 29. What % of page weight is images? Average 45.6% 1 Yahoo! 29% 2 Google 75% 3 YouTube 62% 4 Live.com 64% 5 MSN 41% 6 MySpace 48% 7 Wikipedia 39% 8 Facebook 35% 9 Blogger 27% 10 Yahoo! JP 36%
  • 30. GIF-to-PNG Average 20.42% savings LOSSLESS!
  • 31. Crush PNG Average 16.05% savings LOSSLESS!
  • 32. Strip JPEG metadata Average 11.85% savings LOSSLESS!
  • 33. Optimize images Convert all GIFs to PNGs (and check if there’s a saving) > convert image.gif image.png Crush all PNGs > pngcrush image.png –rem alla –reduce result.png Strip comments from JPEGs > jpegtran -copy none -optimize -perfect src.jpg dest.jpg
  • 34. Case study: Google charts API 1 2 3
  • 35. Case study: Google charts API 1 2 3 Original (707 colors)
  • 36. Case study: Google charts API Original (1408 colors) Crushed (1408 colors) PNG8 (256 colors) 25% saving 55% saving (1000+ colors are lost but who can tell?)
  • 37. Optimize images All sites can optimize images Which (former) presidential candidate had over 200K of useless image information sent over the wire for a single page?!
  • 38. Optimize CSS sprites Combine similar colors Keep color count low (<256) to fit in a PNG8 “ Be mobile-friendly” – don’t leave big gaps
  • 39. Optimize sprites Horizontal may be smaller
  • 40. To sprite or not to sprite? 1. How many pages does your property have? 2. Is your site modular ? (hint: it should be!) 3. How much time can your team spend on site maintenance?
  • 41. tag: mobile
  • 42. Mobile Performance Research Reduce the size of each component to 25 Kb or less. http://yuiblog.com/blog/2008/02/06/iphone-cacheability/ iPhone
  • 43. URLs – Exceptional Performance YUI blog http://yuiblog.com/blog/category/performance/ YDN (Yahoo Developer Network) http://developer.yahoo.com/performance/ YDN blog http://developer.yahoo.net/blog/archives/performance/ Mailing list (Yahoo! Group) http://tech.groups.yahoo.com/group/exceptional-performance/ Feedback http://developer.yahoo.com/yslow/feedback.html
  • 44. URLs (contd.) &quot;When the Cookie Crumbles&quot; Tenni Theurer, Steve Souders http://yuiblog.com/blog/2007/03/01/performance-research-part-3/ &quot;Maximizing Parallel Downloads in the Carpool Lane&quot;, Tenni Theurer, Patty Chi http://yuiblog.com/blog/2007/04/11/performance-research-part-4/ YUI Image Loader ( http://developer.yahoo.com/yui/imageloader/ ) YUI Get ( http://developer.yahoo.com/yui/get/ ) YUI Compressor ( http://developer.yahoo.com/yui/compressor/ contains a Java port of an internal PHP CSS minifier tool written by Isaac Schlueter, http://foohack.com/ ) JSMin ( http://www.crockford.com/javascript/jsmin.html ) &quot;High-performance AJAX applications&quot; Julien Lecompte http://yuiblog.com/blog/2007/12/20/video-lecomte/ Yahoo! engineer Michael J. Radwin talk back in 2004 http://www.radwin.org/michael/talks/
  • 46. Take-home Focus on the front-end Optimize images Be relentlessly user focused Every feature has a cost Start early!
  • 47. Thank you! Nicole Sullivan nicolesl@yahoo-inc.com http://www.stubbornella.org Stoyan Stefanov stoyan@yahoo-inc.com http://www.phpied.com http://developer.yahoo.com/performance

Editor's Notes