High Performance Web Sites Essential Knowledge for Frontend Engineers

Slides:



Advertisements
Similar presentations
High Performance Web Sites 14 rules for faster pages
Advertisements

Optimizing Websites with YSlow Tom Lianza Co-Founder Wishlisting.com Tom Lianza Co-Founder Wishlisting.com.
CS193H: High Performance Web Sites Lecture 9: Rule 5 – Put Stylesheets at the Top Steve Souders Google
CS193H: High Performance Web Sites Lecture 7: Add an Expires Header Steve Souders Google
Steve Souders Even Faster Websites Disclaimer: This content does not necessarily reflect.
High Performance Web Sites best practices for faster pages Steve Souders
Steve Souders Even Faster Themes Disclaimer: This content does not necessarily reflect.
High Performance Web Sites Essential Knowledge for Frontend Engineers
Steve Souders Even Faster Web Sites Disclaimer: This content does not necessarily.
Steve Souders Even Faster Web Sites best practices for faster pages Disclaimer: This.
Steve Souders Even Faster Web Sites (inside ma.tt) best practices for faster pages.
CS193H: High Performance Web Sites Lecture 16: Rule 13 – Configure ETags Steve Souders Google
CS193H: High Performance Web Sites Lecture 4: Class Projects Steve Souders Google
CS193H: High Performance Web Sites Lecture 13: Rule 10 – Minify JavaScript Steve Souders Google
CS193H: High Performance Web Sites Lecture 22: Vol 2 – Optimize Images, Use Iframes Sparingly, Flush the Document Early Steve Souders Google
Steve Souders High Performance Widgets Disclaimer: This content does not necessarily.
Steve Souders Life's too short, write fast code part 1 Disclaimer: This content does.
Steve Souders Even Faster Web Sites best practices for faster pages Disclaimer:
CS193H: High Performance Web Sites Lecture 1: Introduction Steve Souders Google
17% 83% iGoogle, primed cache the importance of frontend performance 9%91% iGoogle, empty cache.
CS193H: High Performance Web Sites Lecture 17: Rule 14 – Make Ajax Cacheable Steve Souders Google
CS193H: High Performance Web Sites Lecture 8: Rule 4 – Gzip Components
High Performance Widgets Steve Souders Chief Performance Yahoo!
CS193H: High Performance Web Sites Lecture 21: Vol 2 – Split Dominant Domains Steve Souders Google
CS193H: High Performance Web Sites Lecture 15: Rule 12 – Remove Duplicate Scripts Steve Souders Google
CS193H: High Performance Web Sites Lecture 23: Vol 2 – Make static content cookie- free, Reduce cookie weight, To WWW or not to WWW Steve Souders Google.
Exceptional Performance Evolution at Yahoo! Steve Souders Chief Performance Yahoo!
CS193H: High Performance Web Sites Lecture 3: HTTP and the Web 100 Performance Profile Steve Souders Google
High Performance Web Sites 14 rules for faster-loading pages Steve Souders Tenni Theurer
CS193H: High Performance Web Sites Lecture 6: Use a CDN Steve Souders Google
Steve Souders Even Faster Web Sites best practices for faster pages Disclaimer: This content does not necessarily.
Steve Souders Life's too short, write fast code part 1 Disclaimer: This content does.
CS193H: High Performance Web Sites Lecture 20: Vol 2 – Don't Scatter Inline Scripts Steve Souders Google
Steve Souders Even Faster Web Sites best practices for faster pages Disclaimer: This content does not necessarily.
High Performance Web Sites 14 rules for faster pages Steve Souders Chief Performance Yahoo!
CS193H: High Performance Web Sites Lecture 5: Make Fewer HTTP Requests Steve Souders Google
CS193H: High Performance Web Sites Lecture 12: Rule 8 – Make JavaScript and CSS External Steve Souders Google
CS193H: High Performance Web Sites Lecture 19: Vol 2 – Load Scripts Without Blocking Steve Souders Google
CS193H: High Performance Web Sites Lecture 10: Rule 6 – Put Scripts at the Bottom Steve Souders Google
CS193H: High Performance Web Sites Lecture 2: The Importance of Frontend Performance Steve Souders Google
High Performance Web Sites 14 rules for faster pages Steve Souders Tenni Theurer
CS193H: High Performance Web Sites Lecture 11: Rule 7 – Avoid CSS Expressions Rule 9 – Reduce DNS Lookups Steve Souders Google
CS193H: High Performance Web Sites Lecture 18: Vol 2 – Split the Initial Payload Steve Souders Google
Web Performance Meetup 1 Web Performance 101 Jeremy
Web Performance Meetup 1 Web Performance Toolbelt Jeremy
Stevesouders.com/docs/velocity-wpo pptx Disclaimer: This content does not necessarily reflect the opinions of my employer.
Best Practices for Speeding Up Your Web Site
Web Site Performance What makes web sites slow? Back end Front end Tools for measuring performance Firebug / YSlow Visual Studio Test Edition W3.org html.
SOCIAL NETWORKS ANALYSIS SEMINAR INTRODUCTORY LECTURE Danny Hendler and Yehonatan Cohen Advanced Topics in on-line Social Networks Analysis.
©2013 AKAMAI | FASTER FORWARD TM It's all about Performance Measured and Perceived Performance on Desktop and Mobile Devices San Mateo Meetup, July 2013.
CHAPTER 15 WEBPAGE OPTIMIZATION. LEARNING OBJECTIVES How to test your web-page performance How browser and server interactions impact performance What.
Improving Web Site Performance and Scalability While Saving Money Robert Boedigheimer ∙ Web Application
Disclaimer: This content does not necessarily reflect the opinions of my employer.
High Performance Websites (Based on Steve Souder’s lecture) By Bhoomi Patel.
Front-end Performance Optimization Using Drupal Fixing all validation errors reported by the Yslow & Page Speed tools.Yslow Page Speed.
Disclaimer: This content does not necessarily reflect the opinions of my employer.
&.zip Disclaimer: This content does not necessarily reflect the opinions of my employer.
Stevesouders.com/docs/velocity-efws pptx Disclaimer: This content does not necessarily reflect the opinions of my employer. flickr.com/photos/ddfic/ /
Mark Phillip markphillip.com 200s, 304s, Expires Headers, HTTP Compression, And You.
Disclaimer: This content does not necessarily reflect the opinions of my employer.
Performance, SEO, Accessibility Ivan Zhekov Telerik Corporation
Web Performance Optimization Boban Stojanovski (Senior Front End Developer at Solaborate) Think Fast by default.
Case Study: Live Search – Moving to and then away from AJAX Eric Schurman Performance Development Lead Live Search Microsoft.
Site Speed: The Ultimate UX Feature… for SEO. A case study on how to increase search engine crawling and online conversion Jonathon Colman In-House SEO.
Enhance Your Page Load Speed And Improve Traffic.
Time is the enemy: Ten Core Lessons for Achieving Peak
Even Faster Web Sites best practices for faster pages
Even Faster Web Sites best practices for faster pages
Hints and tips for faster web apps
High Performance Mobile
Presentation transcript:

High Performance Web Sites Essential Knowledge for Frontend Engineers Photo courtesy of Amnemona: http://www.flickr.com/photos/marinacvinhal/379111290/ Can find these slides on my web site. Steve Souders souders@google.com http://stevesouders.com/ Disclaimer: This content does not necessarily reflect the opinions of my employer.

The Importance of Frontend Performance 9% 91% 17% 83% iGoogle, primed cache iGoogle, empty cache

Time Spent on the Frontend Empty Cache Primed Cache www.aol.com 97% www.ebay.com 95% 81% www.facebook.com www.google.com/search 47% 25% search.live.com/results 67% 0% www.msn.com 98% 94% www.myspace.com en.wikipedia.org/wiki 91% www.yahoo.com 96% www.youtube.com Ten top sites according to Alexa.com. Craigslist is actually #10, but it has no JS or CSS, so I use #11 AOL. Tested on IE6 on Comcast cable modem (~5 mbps) medium powered PC, April 2008. http://www.aol.com/ http://www.ebay.com/ http://www.facebook.com/ http://www.google.com/search?hl=en&q=flowers http://www.myspace.com/ http://www.msn.com/ http://search.live.com/results.aspx?q=flowers&mkt=en-us&scope=&FORM=LIVSOP http://en.wikipedia.org/wiki/Flowers http://www.yahoo.com/ http://www.youtube.com/ For Google and Live Search there are so few components (2-4) and they're mostly cacheable so the HTML document is a bigger percentage.

The Performance Golden Rule 80-90% of the end-user response time is spent on the frontend. Start there. greater potential for improvement simpler If you could cut performance in half, FE changes would be 40-45%, while BE would be only 5-10%. BE changes are typically more complex: rearchitecture, optimize code, add/modify hw, distribute databases, etc. FE is simpler: change web server config, place scripts and stylesheets differently in the page, combine requests, etc. I’ve worked with dev teams to cut response times on 50 properties, often by 25% or more. And feedback from other companies is similar. background photo courtesy of Technicolor: http://flickr.com/photos/technicolor/44988148/ proven to work

14 Rules Make fewer HTTP requests Use a CDN Add an Expires header Gzip components Put stylesheets at the top Put scripts at the bottom Avoid CSS expressions Make JS and CSS external Reduce DNS lookups Minify JS Avoid redirects Remove duplicate scripts Configure ETags Make AJAX cacheable photo courtesy of Vicki & Chuck Rogers: http://www.flickr.com/photos/two-wrongs/205467442/

YSlow High Performance Web Sites

http://conferences.oreilly.com/velocity/ 20% discount: vel08st

Rule 1: Make fewer HTTP requests CSS sprites combined scripts, combined stylesheets image maps inline images

CSS Sprites size of combined image is less <span style=" background-image: url('sprites.gif'); background-position: -260px -90px;"> </span> Size of combined image actually decreases due to reduced image overhead (color tables, formatting info, etc.). size of combined image is less

Rule 3: Add an Expires header not just for images Images Stylesheets Scripts % with Expires Median Age amazon.com 0/62 0/1 0/3 0% 114 days aol.com 23/43 1/1 6/18 48% 217 days cnn.com 0/138 0/2 2/11 1% 227 days ebay.com 16/20 0/7 55% 140 days google.com/ig 8/14 2/3 65% 8 days msn.com 32/35 3/9 80% 34 days myspace.com 0/18 1 day wikipedia.org 6/8 75% yahoo.com 23/23 4/4 100% n/a youtube.com 0/32 26 days One thought: you can't put an Expires header because the content is constantly changing. But when we look at the Last-Modified header we see that's not the case. For MySpace it is, but Amazon, CNN, Froogle and YouTube all have lengthier Last_modified values.

Rule 5: Put stylesheets at the top stylesheets block rendering in IE solution: put stylesheets in HEAD (per spec) avoids Flash of Unstyled Content use LINK (not @import) Unfortunately, this is bad for FF because in FF stylesheets block parallel downloads.

Rule 6: Move scripts to the bottom scripts block parallel downloads across all hostnames scripts block rendering of everything below them in the page move scripts as low in the page as possible

Even Faster Web Sites Split the initial payload Load scripts without blocking Don't scatter scripts Split dominant content domains Make static content cookie-free Reduce cookie weight Minify CSS Optimize images Use iframes sparingly To www or not to www

Why focus on JavaScript? Yahoo! YouTube AOL Wikipedia eBay Facebook MySpace The JavaScript for features like dropdown menus and feedback could and should be downloaded AFTER the initial page has been rendered.

Live Analysis http://www.yahoo.com/ - for a complex page it's great this gets an A http://www.google.com/ig - http://www.orkut.com/ - notice the .js isn't downloaded in parallel with the .css http://www.msn.com/ - notice the parallel script downloads

Takeaways focus on the frontend run YSlow: http://developer.yahoo.com/yslow Velocity: http://conferences.oreilly.com/velocity/ speed matters you CAN make your site even faster! Even if you're site seems fast to you (at work), there are always people on slower connections and people outside the US for whom it's not so fast. Even if you're #1 in your market, there's always a startup coming up that may be faster.

Steve Souders souders@google.com http://stevesouders.com/ "thank you" by nj dodge: http://flickr.com/photos/nj_dodge/187190601/ Steve Souders souders@google.com http://stevesouders.com/