Frontend SPOF

Patrick Meenan
Patrick MeenanSoftware Engineer at Facebook
Frontend SPOF
Patrick Meenan




                 Google Confidential and Proprietary
Credit where credit is due

                   June 2010 - Steve Souders

    http://www.stevesouders.com/blog/2010/06/01/frontend-spof/




                                                         Google Confidential and Proprietary
See what it looks like: http://youtu.be/prToLDpjmPw




                                              Google Confidential and Proprietary
All Because of...
<script src="https://platform.twitter.com/anywhere.js?id=ZV0JHq7YJkjozsfohDIleQ&v=1" type="text/javascript"
></script>




                                                                                                   Google Confidential and Proprietary
What Monitoring Says...
Active Monitoring
    ○ Server Monitoring
      ✔ Base page responded in 1.5 Seconds
   ○ Full-Browser Monitoring
      ✔ Page loaded in 29 Seconds (test timeout is 60)


Real-User Reporting
   ○ Analytics Page Views
      ✔ Analytics loaded and executed asynchronously
   ○ RUM Performance
      ✔ If user bailed before onload there is no performance data




                                                             Google Confidential and Proprietary
It Gets Worse!
Windows Socket Connect Timeout: 20s

Mac/Linux Socket Connect Timeout: Much Higher

                 PER CONNECTION




                                            Google Confidential and Proprietary
There's More!
On that one page, all before the main content:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>


<script type="text/javascript" src="http://scripts.verticalacuity.com/vat/mon/vt.js?1329448814"></script>


<script type="text/javascript" src="http://cdn.sailthru.com/scout/v1.js?1329448814"></script>


<script type="text/javascript" src="//cdn.optimizely.com/js/20728634.js?1329448814"></script>


<script src="https://platform.twitter.com/anywhere.js?..." type="text/javascript"></script>




                                                                                              Google Confidential and Proprietary
But I'd notice it is down...




                           Google Confidential and Proprietary
In Iran?




                                                                                                                  Google Confidential and Proprietary
https://blogs.akamai.com/2012/02/a-view-of-the-iranian-internet-blockade-from-akamais-intelligent-platform.html
or China?




                                                                Google Confidential and Proprietary
http://calendar.perfplanet.com/2011/frontend-spof-in-beijing/
We have solutions...




                       Google Confidential and Proprietary
Async Snippet
Good for code with no dependencies (widgets):




                                                Google Confidential and Proprietary
Async Loaders
Help for chaining together dependencies

Control.js
     ○   http://stevesouders.com/controljs/
LABjs
     ○   http://labjs.com/



● Remember to load the loader safely

● Requires a fair bit of manual work



                                              Google Confidential and Proprietary
Put scripts at the bottom




                                                      Google Confidential and Proprietary
http://stevesouders.com/examples/rule-js-bottom.php
Well...




          Google Confidential and Proprietary
Almost...




                                                                      Blocks onload except on IE and iOS 4




                                                                                                Google Confidential and Proprietary
http://www.stevesouders.com/blog/2012/01/13/javascript-performance/
So, How are we doing?




                        Google Confidential and Proprietary
Widgets
Google Analytics: Async
Google +1: Async
Twitter: Async
Facebook: Async
Delicious: Async (image/href)
StumbleUpon: Async
Digg: Async
Reditt: Blocking
AddThis: Blocking
ShareThis: Blocking

(as of February 2012)
                                Google Confidential and Proprietary
Code Libraries (samples)
Jquery: Blocking in the head
Closure Library: Blocking in the head
YUI: Blocking
Dojo: Blocking in the head
Moo Tools: Blocking in the head
Google API's: Blocking (default, Async available in docs)




                                                 Google Confidential and Proprietary
Popular CMS's

Wordpress: Blocking in the head

Drupal: Blocking in the head

Joomla: Blocking in the head




                                  Google Confidential and Proprietary
Testing for Frontend SPOF




                       Google Confidential and Proprietary
Routing to localhost

Fails FAST! (connections are rejected)

Not good for testing real failure scenarios




                                              Google Confidential and Proprietary
You need a black hole
                          blackhole.webpagetest.org                           72.66.115.13




   Hosts File                                                          On WebPagetest
                                                                       setDnsName ajax.googleapis.com blackhole.webpagetest.org
   72.66.115.13 ajax.googleapis.com                                    setDnsName apis.google.com blackhole.webpagetest.org
   72.66.115.13 apis.google.com                                        setDnsName www.google-analytics.com blackhole.webpagetest.org
   72.66.115.13 www.google-analytics.com                               setDnsName connect.facebook.net blackhole.webpagetest.org
                                                                       setDnsName platform.twitter.com blackhole.webpagetest.org
   72.66.115.13 connect.facebook.net                                   ...
   72.66.115.13 platform.twitter.com                                   navigate your.url.com
   ...


                                                                                                           Google Confidential and Proprietary
http://blog.patrickmeenan.com/2011/10/testing-for-frontend-spof.html            http://www.jpl.nasa.go/spaceimages/details.php?id=PIA13168
How pervasive is the problem?




                          Google Confidential and Proprietary
"Broken" Sites
●   CNN
●   MSNBC
●   New York Times
●   LA Times
●   Bloomberg
●   ABC News
●   CNet news.com
●   Pinterest
●   ESPN
●   AARP
●   Business Insider

...From just 20 minutes of looking
                                     Google Confidential and Proprietary
What do we need to do?




                         Google Confidential and Proprietary
Browsers
● Provide an easier way to asynchronously load complex
  dependency chains
  ○ async does not maintain order
  ○ defer does not work for inline scripts
     ■ and is broken in several versions of IE

● Not block onload for Async scripts
  ○ Sadly, the spec requires onload blocking

● Implement Resource Timing



                                               Google Confidential and Proprietary
Widget Owners
● Never EVER provide blocking snippets

● All examples should be asynchronous

● Do not force HTTPS if it isn't required

● Where possible, allow for sites to self-host any critical
  code




                                                   Google Confidential and Proprietary
CMS Developers
● Build frameworks that encourage async code loading
  (and encourage their use for default operation)

● Provide a mechanism for tracking the performance of
  individual plugins




                                              Google Confidential and Proprietary
Site Owners
●   Never load resources that you do not control synchronously (and refuse
    3rd party code that doesn't have an async option)

●   Do not rely on onload for important functionality


●   Make sure your monitoring has aggressive time limits (under 20 seconds)


●   Make sure your RUM reporting has an aggressive timeout


●   Track RUM failures by region


●   Leverage Resource Timing and field RUM analytics when available




                                                               Google Confidential and Proprietary
1 of 30

Recommended

Cache is King by
Cache is KingCache is King
Cache is KingSteve Souders
6.6K views70 slides
High Performance Snippets by
High Performance SnippetsHigh Performance Snippets
High Performance SnippetsSteve Souders
5.9K views33 slides
Your Script Just Killed My Site by
Your Script Just Killed My SiteYour Script Just Killed My Site
Your Script Just Killed My SiteSteve Souders
10.5K views30 slides
Measuring Web Performance (HighEdWeb FL Edition) by
Measuring Web Performance (HighEdWeb FL Edition)Measuring Web Performance (HighEdWeb FL Edition)
Measuring Web Performance (HighEdWeb FL Edition)Dave Olsen
3.2K views68 slides
High Performance JavaScript (Amazon DevCon 2011) by
High Performance JavaScript (Amazon DevCon 2011)High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)Nicholas Zakas
4.6K views155 slides
State of the resource timing api by
State of the resource timing apiState of the resource timing api
State of the resource timing apiAaron Peters
4.7K views21 slides

More Related Content

What's hot

Prebrowsing - Velocity NY 2013 by
Prebrowsing - Velocity NY 2013Prebrowsing - Velocity NY 2013
Prebrowsing - Velocity NY 2013Steve Souders
4.3K views60 slides
Progressive Enhancement 2.0 (Conference Agnostic) by
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Nicholas Zakas
42.5K views125 slides
@media - Even Faster Web Sites by
@media - Even Faster Web Sites@media - Even Faster Web Sites
@media - Even Faster Web SitesSteve Souders
11.5K views50 slides
Web 2.0 Expo: Even Faster Web Sites by
Web 2.0 Expo: Even Faster Web SitesWeb 2.0 Expo: Even Faster Web Sites
Web 2.0 Expo: Even Faster Web SitesSteve Souders
6.6K views34 slides
Browser Wars Episode 1: The Phantom Menace by
Browser Wars Episode 1: The Phantom MenaceBrowser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceNicholas Zakas
77.4K views168 slides
High Performance HTML5 (SF HTML5 UG) by
High Performance HTML5 (SF HTML5 UG)High Performance HTML5 (SF HTML5 UG)
High Performance HTML5 (SF HTML5 UG)Steve Souders
15.3K views43 slides

What's hot(20)

Prebrowsing - Velocity NY 2013 by Steve Souders
Prebrowsing - Velocity NY 2013Prebrowsing - Velocity NY 2013
Prebrowsing - Velocity NY 2013
Steve Souders4.3K views
Progressive Enhancement 2.0 (Conference Agnostic) by Nicholas Zakas
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
Nicholas Zakas42.5K views
@media - Even Faster Web Sites by Steve Souders
@media - Even Faster Web Sites@media - Even Faster Web Sites
@media - Even Faster Web Sites
Steve Souders11.5K views
Web 2.0 Expo: Even Faster Web Sites by Steve Souders
Web 2.0 Expo: Even Faster Web SitesWeb 2.0 Expo: Even Faster Web Sites
Web 2.0 Expo: Even Faster Web Sites
Steve Souders6.6K views
Browser Wars Episode 1: The Phantom Menace by Nicholas Zakas
Browser Wars Episode 1: The Phantom MenaceBrowser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom Menace
Nicholas Zakas77.4K views
High Performance HTML5 (SF HTML5 UG) by Steve Souders
High Performance HTML5 (SF HTML5 UG)High Performance HTML5 (SF HTML5 UG)
High Performance HTML5 (SF HTML5 UG)
Steve Souders15.3K views
Mobile Web Speed Bumps by Nicholas Zakas
Mobile Web Speed BumpsMobile Web Speed Bumps
Mobile Web Speed Bumps
Nicholas Zakas13.4K views
Front End Development for Back End Java Developers - Jfokus 2020 by Matt Raible
Front End Development for Back End Java Developers - Jfokus 2020Front End Development for Back End Java Developers - Jfokus 2020
Front End Development for Back End Java Developers - Jfokus 2020
Matt Raible181 views
[jqconatx] Adaptive Images for Responsive Web Design by Christopher Schmitt
[jqconatx] Adaptive Images for Responsive Web Design[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design
Christopher Schmitt31.4K views
Performance on the Yahoo! Homepage by Nicholas Zakas
Performance on the Yahoo! HomepagePerformance on the Yahoo! Homepage
Performance on the Yahoo! Homepage
Nicholas Zakas7.9K views
High Performance JavaScript (YUIConf 2010) by Nicholas Zakas
High Performance JavaScript (YUIConf 2010)High Performance JavaScript (YUIConf 2010)
High Performance JavaScript (YUIConf 2010)
Nicholas Zakas61.8K views
How to investigate and recover from a security breach in WordPress by Otto Kekäläinen
How to investigate and recover from a security breach in WordPressHow to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPress
implement lighthouse-ci with your web development workflow by WordPress
implement lighthouse-ci with your web development workflowimplement lighthouse-ci with your web development workflow
implement lighthouse-ci with your web development workflow
WordPress113 views
Clojure Web Development by Hong Jiang
Clojure Web DevelopmentClojure Web Development
Clojure Web Development
Hong Jiang1.3K views
Javascript Security - Three main methods of defending your MEAN stack by Ran Bar-Zik
Javascript Security - Three main methods of defending your MEAN stackJavascript Security - Three main methods of defending your MEAN stack
Javascript Security - Three main methods of defending your MEAN stack
Ran Bar-Zik2K views
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat by VMware Hyperic
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache TomcatCase Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
VMware Hyperic16.4K views
Apache Roller, Acegi Security and Single Sign-on by Matt Raible
Apache Roller, Acegi Security and Single Sign-onApache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-on
Matt Raible2.2K views
Optimizing your WordPress website by mwfordesigns
Optimizing your WordPress websiteOptimizing your WordPress website
Optimizing your WordPress website
mwfordesigns657 views

Viewers also liked

Front End Tooling and Performance - Codeaholics HK 2015 by
Front End Tooling and Performance - Codeaholics HK 2015Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015Holger Bartel
1.5K views43 slides
Frontend automation and stability by
Frontend automation and stabilityFrontend automation and stability
Frontend automation and stabilityMáté Nádasdi
2.3K views45 slides
Sinau Bareng Frontend Web Development @ DiLo Malang by
Sinau Bareng Frontend Web Development @ DiLo MalangSinau Bareng Frontend Web Development @ DiLo Malang
Sinau Bareng Frontend Web Development @ DiLo MalangMoch. Zamroni
1.6K views14 slides
Webinar: Front End Web Development - Trendy Web Designs Using HTML5 by
Webinar: Front End Web Development - Trendy Web Designs Using HTML5Webinar: Front End Web Development - Trendy Web Designs Using HTML5
Webinar: Front End Web Development - Trendy Web Designs Using HTML5Edureka!
4.5K views31 slides
User eXperience & Front End Development by
User eXperience & Front End DevelopmentUser eXperience & Front End Development
User eXperience & Front End Developmentandreafallaswork
1.1K views28 slides
Front end Tips Tricks & Tools by
Front end Tips Tricks & ToolsFront end Tips Tricks & Tools
Front end Tips Tricks & ToolsSandeep Ramgolam
922 views30 slides

Viewers also liked(20)

Front End Tooling and Performance - Codeaholics HK 2015 by Holger Bartel
Front End Tooling and Performance - Codeaholics HK 2015Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015
Holger Bartel1.5K views
Frontend automation and stability by Máté Nádasdi
Frontend automation and stabilityFrontend automation and stability
Frontend automation and stability
Máté Nádasdi2.3K views
Sinau Bareng Frontend Web Development @ DiLo Malang by Moch. Zamroni
Sinau Bareng Frontend Web Development @ DiLo MalangSinau Bareng Frontend Web Development @ DiLo Malang
Sinau Bareng Frontend Web Development @ DiLo Malang
Moch. Zamroni1.6K views
Webinar: Front End Web Development - Trendy Web Designs Using HTML5 by Edureka!
Webinar: Front End Web Development - Trendy Web Designs Using HTML5Webinar: Front End Web Development - Trendy Web Designs Using HTML5
Webinar: Front End Web Development - Trendy Web Designs Using HTML5
Edureka!4.5K views
User eXperience & Front End Development by andreafallaswork
User eXperience & Front End DevelopmentUser eXperience & Front End Development
User eXperience & Front End Development
andreafallaswork1.1K views
Grunt js for the Enterprise Vol.1: Frontend Performance with Phantomas by David Amend
Grunt js for the Enterprise Vol.1: Frontend Performance with PhantomasGrunt js for the Enterprise Vol.1: Frontend Performance with Phantomas
Grunt js for the Enterprise Vol.1: Frontend Performance with Phantomas
David Amend2.9K views
建立前端开发团队 (Front-end Development Environment) by Joseph Chiang
建立前端开发团队 (Front-end Development Environment)建立前端开发团队 (Front-end Development Environment)
建立前端开发团队 (Front-end Development Environment)
Joseph Chiang4.1K views
Wrangling Large Scale Frontend Web Applications by Ryan Roemer
Wrangling Large Scale Frontend Web ApplicationsWrangling Large Scale Frontend Web Applications
Wrangling Large Scale Frontend Web Applications
Ryan Roemer48.1K views
A modern front end development workflow for Magnolia at Atlassian by Magnolia
A modern front end development workflow for Magnolia at AtlassianA modern front end development workflow for Magnolia at Atlassian
A modern front end development workflow for Magnolia at Atlassian
Magnolia1.8K views
How to Build Front-End Web Apps that Scale - FutureJS by Phil Leggetter
How to Build Front-End Web Apps that Scale - FutureJSHow to Build Front-End Web Apps that Scale - FutureJS
How to Build Front-End Web Apps that Scale - FutureJS
Phil Leggetter4.4K views
W3 conf hill-html5-security-realities by Brad Hill
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
Brad Hill10.4K views
Frontend at Scale - The Tumblr Story by Chris Miller
Frontend at Scale - The Tumblr StoryFrontend at Scale - The Tumblr Story
Frontend at Scale - The Tumblr Story
Chris Miller8.1K views
Modern Frontend Technology by Ship Hsu
Modern Frontend TechnologyModern Frontend Technology
Modern Frontend Technology
Ship Hsu1.5K views
TechTalk #85 : Latest Frontend Technologies by bincangteknologi
TechTalk #85 : Latest Frontend TechnologiesTechTalk #85 : Latest Frontend Technologies
TechTalk #85 : Latest Frontend Technologies
bincangteknologi1.1K views
Front End Development Workflow Tools by Ahmed Elmehri
Front End Development Workflow ToolsFront End Development Workflow Tools
Front End Development Workflow Tools
Ahmed Elmehri721 views
The Frontend Developer Landscape Explained and the Rise of Advanced Frontend ... by Prasid Pathak
The Frontend Developer Landscape Explained and the Rise of Advanced Frontend ...The Frontend Developer Landscape Explained and the Rise of Advanced Frontend ...
The Frontend Developer Landscape Explained and the Rise of Advanced Frontend ...
Prasid Pathak4.5K views
engage 2015 - Domino App Development - Where should I go now? by René Winkelmeyer
engage 2015 - Domino App Development - Where should I go now?engage 2015 - Domino App Development - Where should I go now?
engage 2015 - Domino App Development - Where should I go now?
René Winkelmeyer761 views

Similar to Frontend SPOF

Preconnect, prefetch, prerender... by
Preconnect, prefetch, prerender...Preconnect, prefetch, prerender...
Preconnect, prefetch, prerender...MilanAryal
2.4K views22 slides
Google I/O 2012 - Protecting your user experience while integrating 3rd party... by
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Patrick Meenan
3K views51 slides
Grunt.js and Yeoman, Continous Integration by
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationDavid Amend
30.8K views63 slides
20 tips for website performance by
20 tips for website performance20 tips for website performance
20 tips for website performanceAndrew Siemer
103 views61 slides
Scraping the web with Laravel, Dusk, Docker, and PHP by
Scraping the web with Laravel, Dusk, Docker, and PHPScraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHPPaul Redmond
7.8K views81 slides
Mobile backends with Google Cloud Platform (MBLTDev'14) by
Mobile backends with Google Cloud Platform (MBLTDev'14)Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)Natalia Efimtseva
515 views36 slides

Similar to Frontend SPOF(20)

Preconnect, prefetch, prerender... by MilanAryal
Preconnect, prefetch, prerender...Preconnect, prefetch, prerender...
Preconnect, prefetch, prerender...
MilanAryal2.4K views
Google I/O 2012 - Protecting your user experience while integrating 3rd party... by Patrick Meenan
Google I/O 2012 - Protecting your user experience while integrating 3rd party...Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
Patrick Meenan3K views
Grunt.js and Yeoman, Continous Integration by David Amend
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
David Amend30.8K views
20 tips for website performance by Andrew Siemer
20 tips for website performance20 tips for website performance
20 tips for website performance
Andrew Siemer103 views
Scraping the web with Laravel, Dusk, Docker, and PHP by Paul Redmond
Scraping the web with Laravel, Dusk, Docker, and PHPScraping the web with Laravel, Dusk, Docker, and PHP
Scraping the web with Laravel, Dusk, Docker, and PHP
Paul Redmond7.8K views
Mobile backends with Google Cloud Platform (MBLTDev'14) by Natalia Efimtseva
Mobile backends with Google Cloud Platform (MBLTDev'14)Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)
Natalia Efimtseva515 views
Deep crawl the chaotic landscape of JavaScript by Onely
Deep crawl the chaotic landscape of JavaScript Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript
Onely11.7K views
YouTube Mobile Webapp: On the edge of Html5 by SMART DevNet
YouTube Mobile Webapp: On the edge of Html5YouTube Mobile Webapp: On the edge of Html5
YouTube Mobile Webapp: On the edge of Html5
SMART DevNet3.2K views
OWASP ZAP Workshop for QA Testers by Javan Rasokat
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
Javan Rasokat104.9K views
Detecting headless browsers by Sergey Shekyan
Detecting headless browsersDetecting headless browsers
Detecting headless browsers
Sergey Shekyan25.9K views
Velocity EU 2012 - Third party scripts and you by Patrick Meenan
Velocity EU 2012 - Third party scripts and youVelocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and you
Patrick Meenan2.6K views
Google Chronicles: Analytics And Chrome by Sarah Dutkiewicz
Google Chronicles: Analytics And ChromeGoogle Chronicles: Analytics And Chrome
Google Chronicles: Analytics And Chrome
Sarah Dutkiewicz966 views
Shining a light on performance (js meetup) by Yoav Niran
Shining a light on performance (js meetup)Shining a light on performance (js meetup)
Shining a light on performance (js meetup)
Yoav Niran131 views
Zagat.com Case Study (DrupalCon Denver 2012) by Phase2
Zagat.com Case Study (DrupalCon Denver 2012)Zagat.com Case Study (DrupalCon Denver 2012)
Zagat.com Case Study (DrupalCon Denver 2012)
Phase21.8K views
DevOops & How I hacked you DevopsDays DC June 2015 by Chris Gates
DevOops & How I hacked you DevopsDays DC June 2015DevOops & How I hacked you DevopsDays DC June 2015
DevOops & How I hacked you DevopsDays DC June 2015
Chris Gates3.2K views
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13 by Fred Sauer
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
Fred Sauer1.5K views
vodQA Pune (2019) - Browser automation using dev tools by vodQA
vodQA Pune (2019) - Browser automation using dev toolsvodQA Pune (2019) - Browser automation using dev tools
vodQA Pune (2019) - Browser automation using dev tools
vodQA642 views
WebPagetest Power Users - Velocity 2014 by Patrick Meenan
WebPagetest Power Users - Velocity 2014WebPagetest Power Users - Velocity 2014
WebPagetest Power Users - Velocity 2014
Patrick Meenan8.8K views

More from Patrick Meenan

Resource Prioritization by
Resource PrioritizationResource Prioritization
Resource PrioritizationPatrick Meenan
1.4K views46 slides
HTTP/2 Prioritization by
HTTP/2 PrioritizationHTTP/2 Prioritization
HTTP/2 PrioritizationPatrick Meenan
3.1K views68 slides
Getting the most out of WebPageTest by
Getting the most out of WebPageTestGetting the most out of WebPageTest
Getting the most out of WebPageTestPatrick Meenan
2.3K views64 slides
Http2 in practice by
Http2 in practiceHttp2 in practice
Http2 in practicePatrick Meenan
2.9K views169 slides
Resource loading, prioritization, HTTP/2 - oh my! by
Resource loading, prioritization, HTTP/2 - oh my!Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!Patrick Meenan
1.9K views40 slides
How fast is it? by
How fast is it?How fast is it?
How fast is it?Patrick Meenan
3.8K views40 slides

More from Patrick Meenan(20)

Getting the most out of WebPageTest by Patrick Meenan
Getting the most out of WebPageTestGetting the most out of WebPageTest
Getting the most out of WebPageTest
Patrick Meenan2.3K views
Resource loading, prioritization, HTTP/2 - oh my! by Patrick Meenan
Resource loading, prioritization, HTTP/2 - oh my!Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!
Patrick Meenan1.9K views
Scaling Front-End Performance - Velocity 2016 by Patrick Meenan
Scaling Front-End Performance - Velocity 2016Scaling Front-End Performance - Velocity 2016
Scaling Front-End Performance - Velocity 2016
Patrick Meenan1.9K views
Machine Learning RUM - Velocity 2016 by Patrick Meenan
Machine Learning RUM - Velocity 2016Machine Learning RUM - Velocity 2016
Machine Learning RUM - Velocity 2016
Patrick Meenan852 views
TLS - 2016 Velocity Training by Patrick Meenan
TLS - 2016 Velocity TrainingTLS - 2016 Velocity Training
TLS - 2016 Velocity Training
Patrick Meenan970 views
Service workers - Velocity 2016 Training by Patrick Meenan
Service workers - Velocity 2016 TrainingService workers - Velocity 2016 Training
Service workers - Velocity 2016 Training
Patrick Meenan668 views
Front-End Single Point of Failure - Velocity 2016 Training by Patrick Meenan
Front-End Single Point of Failure - Velocity 2016 TrainingFront-End Single Point of Failure - Velocity 2016 Training
Front-End Single Point of Failure - Velocity 2016 Training
Patrick Meenan757 views
Measuring performance - Velocity 2016 Training by Patrick Meenan
Measuring performance - Velocity 2016 TrainingMeasuring performance - Velocity 2016 Training
Measuring performance - Velocity 2016 Training
Patrick Meenan880 views
Service Workers for Performance by Patrick Meenan
Service Workers for PerformanceService Workers for Performance
Service Workers for Performance
Patrick Meenan8.1K views
Velocity 2014 nyc WebPagetest private instances by Patrick Meenan
Velocity 2014 nyc   WebPagetest private instancesVelocity 2014 nyc   WebPagetest private instances
Velocity 2014 nyc WebPagetest private instances
Patrick Meenan8.5K views
Mobile web performance - MoDev East by Patrick Meenan
Mobile web performance - MoDev EastMobile web performance - MoDev East
Mobile web performance - MoDev East
Patrick Meenan3.4K views
Tracking Performance - Velocity NYC 2013 by Patrick Meenan
Tracking Performance - Velocity NYC 2013Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013
Patrick Meenan4.9K views
Measuring the visual experience of website performance by Patrick Meenan
Measuring the visual experience of website performanceMeasuring the visual experience of website performance
Measuring the visual experience of website performance
Patrick Meenan2.6K views
Selecting and deploying automated optimization solutions by Patrick Meenan
Selecting and deploying automated optimization solutionsSelecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutions
Patrick Meenan1.4K views
Velocity 2012 - Taming the Mobile Beast by Patrick Meenan
Velocity 2012 - Taming the Mobile BeastVelocity 2012 - Taming the Mobile Beast
Velocity 2012 - Taming the Mobile Beast
Patrick Meenan54.3K views

Recently uploaded

Zero to Automated in Under a Year by
Zero to Automated in Under a YearZero to Automated in Under a Year
Zero to Automated in Under a YearNetwork Automation Forum
15 views23 slides
Melek BEN MAHMOUD.pdf by
Melek BEN MAHMOUD.pdfMelek BEN MAHMOUD.pdf
Melek BEN MAHMOUD.pdfMelekBenMahmoud
14 views1 slide
20231123_Camunda Meetup Vienna.pdf by
20231123_Camunda Meetup Vienna.pdf20231123_Camunda Meetup Vienna.pdf
20231123_Camunda Meetup Vienna.pdfPhactum Softwareentwicklung GmbH
41 views73 slides
HTTP headers that make your website go faster - devs.gent November 2023 by
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023Thijs Feryn
22 views151 slides
virtual reality.pptx by
virtual reality.pptxvirtual reality.pptx
virtual reality.pptxG036GaikwadSnehal
14 views15 slides
PharoJS - Zürich Smalltalk Group Meetup November 2023 by
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023Noury Bouraqadi
132 views17 slides

Recently uploaded(20)

HTTP headers that make your website go faster - devs.gent November 2023 by Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn22 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi132 views
Voice Logger - Telephony Integration Solution at Aegis by Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma39 views
STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb14 views
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... by TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc11 views
"Running students' code in isolation. The hard way", Yurii Holiuk by Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays17 views
Piloting & Scaling Successfully With Microsoft Viva by Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software280 views
Unit 1_Lecture 2_Physical Design of IoT.pdf by StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson92 views

Frontend SPOF

  • 1. Frontend SPOF Patrick Meenan Google Confidential and Proprietary
  • 2. Credit where credit is due June 2010 - Steve Souders http://www.stevesouders.com/blog/2010/06/01/frontend-spof/ Google Confidential and Proprietary
  • 3. See what it looks like: http://youtu.be/prToLDpjmPw Google Confidential and Proprietary
  • 4. All Because of... <script src="https://platform.twitter.com/anywhere.js?id=ZV0JHq7YJkjozsfohDIleQ&v=1" type="text/javascript" ></script> Google Confidential and Proprietary
  • 5. What Monitoring Says... Active Monitoring ○ Server Monitoring ✔ Base page responded in 1.5 Seconds ○ Full-Browser Monitoring ✔ Page loaded in 29 Seconds (test timeout is 60) Real-User Reporting ○ Analytics Page Views ✔ Analytics loaded and executed asynchronously ○ RUM Performance ✔ If user bailed before onload there is no performance data Google Confidential and Proprietary
  • 6. It Gets Worse! Windows Socket Connect Timeout: 20s Mac/Linux Socket Connect Timeout: Much Higher PER CONNECTION Google Confidential and Proprietary
  • 7. There's More! On that one page, all before the main content: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript" src="http://scripts.verticalacuity.com/vat/mon/vt.js?1329448814"></script> <script type="text/javascript" src="http://cdn.sailthru.com/scout/v1.js?1329448814"></script> <script type="text/javascript" src="//cdn.optimizely.com/js/20728634.js?1329448814"></script> <script src="https://platform.twitter.com/anywhere.js?..." type="text/javascript"></script> Google Confidential and Proprietary
  • 8. But I'd notice it is down... Google Confidential and Proprietary
  • 9. In Iran? Google Confidential and Proprietary https://blogs.akamai.com/2012/02/a-view-of-the-iranian-internet-blockade-from-akamais-intelligent-platform.html
  • 10. or China? Google Confidential and Proprietary http://calendar.perfplanet.com/2011/frontend-spof-in-beijing/
  • 11. We have solutions... Google Confidential and Proprietary
  • 12. Async Snippet Good for code with no dependencies (widgets): Google Confidential and Proprietary
  • 13. Async Loaders Help for chaining together dependencies Control.js ○ http://stevesouders.com/controljs/ LABjs ○ http://labjs.com/ ● Remember to load the loader safely ● Requires a fair bit of manual work Google Confidential and Proprietary
  • 14. Put scripts at the bottom Google Confidential and Proprietary http://stevesouders.com/examples/rule-js-bottom.php
  • 15. Well... Google Confidential and Proprietary
  • 16. Almost... Blocks onload except on IE and iOS 4 Google Confidential and Proprietary http://www.stevesouders.com/blog/2012/01/13/javascript-performance/
  • 17. So, How are we doing? Google Confidential and Proprietary
  • 18. Widgets Google Analytics: Async Google +1: Async Twitter: Async Facebook: Async Delicious: Async (image/href) StumbleUpon: Async Digg: Async Reditt: Blocking AddThis: Blocking ShareThis: Blocking (as of February 2012) Google Confidential and Proprietary
  • 19. Code Libraries (samples) Jquery: Blocking in the head Closure Library: Blocking in the head YUI: Blocking Dojo: Blocking in the head Moo Tools: Blocking in the head Google API's: Blocking (default, Async available in docs) Google Confidential and Proprietary
  • 20. Popular CMS's Wordpress: Blocking in the head Drupal: Blocking in the head Joomla: Blocking in the head Google Confidential and Proprietary
  • 21. Testing for Frontend SPOF Google Confidential and Proprietary
  • 22. Routing to localhost Fails FAST! (connections are rejected) Not good for testing real failure scenarios Google Confidential and Proprietary
  • 23. You need a black hole blackhole.webpagetest.org 72.66.115.13 Hosts File On WebPagetest setDnsName ajax.googleapis.com blackhole.webpagetest.org 72.66.115.13 ajax.googleapis.com setDnsName apis.google.com blackhole.webpagetest.org 72.66.115.13 apis.google.com setDnsName www.google-analytics.com blackhole.webpagetest.org 72.66.115.13 www.google-analytics.com setDnsName connect.facebook.net blackhole.webpagetest.org setDnsName platform.twitter.com blackhole.webpagetest.org 72.66.115.13 connect.facebook.net ... 72.66.115.13 platform.twitter.com navigate your.url.com ... Google Confidential and Proprietary http://blog.patrickmeenan.com/2011/10/testing-for-frontend-spof.html http://www.jpl.nasa.go/spaceimages/details.php?id=PIA13168
  • 24. How pervasive is the problem? Google Confidential and Proprietary
  • 25. "Broken" Sites ● CNN ● MSNBC ● New York Times ● LA Times ● Bloomberg ● ABC News ● CNet news.com ● Pinterest ● ESPN ● AARP ● Business Insider ...From just 20 minutes of looking Google Confidential and Proprietary
  • 26. What do we need to do? Google Confidential and Proprietary
  • 27. Browsers ● Provide an easier way to asynchronously load complex dependency chains ○ async does not maintain order ○ defer does not work for inline scripts ■ and is broken in several versions of IE ● Not block onload for Async scripts ○ Sadly, the spec requires onload blocking ● Implement Resource Timing Google Confidential and Proprietary
  • 28. Widget Owners ● Never EVER provide blocking snippets ● All examples should be asynchronous ● Do not force HTTPS if it isn't required ● Where possible, allow for sites to self-host any critical code Google Confidential and Proprietary
  • 29. CMS Developers ● Build frameworks that encourage async code loading (and encourage their use for default operation) ● Provide a mechanism for tracking the performance of individual plugins Google Confidential and Proprietary
  • 30. Site Owners ● Never load resources that you do not control synchronously (and refuse 3rd party code that doesn't have an async option) ● Do not rely on onload for important functionality ● Make sure your monitoring has aggressive time limits (under 20 seconds) ● Make sure your RUM reporting has an aggressive timeout ● Track RUM failures by region ● Leverage Resource Timing and field RUM analytics when available Google Confidential and Proprietary