SlideShare a Scribd company logo
1 of 30
Download to read offline
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

More Related Content

What's hot

Prebrowsing - Velocity NY 2013
Prebrowsing - Velocity NY 2013Prebrowsing - Velocity NY 2013
Prebrowsing - Velocity NY 2013
Steve Souders
 
@media - Even Faster Web Sites
@media - Even Faster Web Sites@media - Even Faster Web Sites
@media - Even Faster Web Sites
Steve Souders
 
Web 2.0 Expo: Even Faster Web Sites
Web 2.0 Expo: Even Faster Web SitesWeb 2.0 Expo: Even Faster Web Sites
Web 2.0 Expo: Even Faster Web Sites
Steve Souders
 
Browser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceBrowser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom Menace
Nicholas Zakas
 
[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design
Christopher Schmitt
 

What's hot (20)

Prebrowsing - Velocity NY 2013
Prebrowsing - Velocity NY 2013Prebrowsing - Velocity NY 2013
Prebrowsing - Velocity NY 2013
 
Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)Progressive Enhancement 2.0 (Conference Agnostic)
Progressive Enhancement 2.0 (Conference Agnostic)
 
@media - Even Faster Web Sites
@media - Even Faster Web Sites@media - Even Faster Web Sites
@media - Even Faster Web Sites
 
Web 2.0 Expo: Even Faster Web Sites
Web 2.0 Expo: Even Faster Web SitesWeb 2.0 Expo: Even Faster Web Sites
Web 2.0 Expo: Even Faster Web Sites
 
Browser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom MenaceBrowser Wars Episode 1: The Phantom Menace
Browser Wars Episode 1: The Phantom Menace
 
High Performance HTML5 (SF HTML5 UG)
High Performance HTML5 (SF HTML5 UG)High Performance HTML5 (SF HTML5 UG)
High Performance HTML5 (SF HTML5 UG)
 
Mobile Web Speed Bumps
Mobile Web Speed BumpsMobile Web Speed Bumps
Mobile Web Speed Bumps
 
Front End Development for Back End Java Developers - Jfokus 2020
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
 
[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design[jqconatx] Adaptive Images for Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design
 
Word campktm speed-security
Word campktm speed-securityWord campktm speed-security
Word campktm speed-security
 
Performance on the Yahoo! Homepage
Performance on the Yahoo! HomepagePerformance on the Yahoo! Homepage
Performance on the Yahoo! Homepage
 
High Performance JavaScript (YUIConf 2010)
High Performance JavaScript (YUIConf 2010)High Performance JavaScript (YUIConf 2010)
High Performance JavaScript (YUIConf 2010)
 
How to investigate and recover from a security breach in WordPress
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
implement lighthouse-ci with your web development workflowimplement lighthouse-ci with your web development workflow
implement lighthouse-ci with your web development workflow
 
do u webview?
do u webview?do u webview?
do u webview?
 
Clojure Web Development
Clojure Web DevelopmentClojure Web Development
Clojure Web Development
 
Javascript Security - Three main methods of defending your MEAN stack
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
 
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
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
 
Apache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-onApache Roller, Acegi Security and Single Sign-on
Apache Roller, Acegi Security and Single Sign-on
 
Optimizing your WordPress website
Optimizing your WordPress websiteOptimizing your WordPress website
Optimizing your WordPress website
 

Viewers also liked

Wrangling Large Scale Frontend Web Applications
Wrangling Large Scale Frontend Web ApplicationsWrangling Large Scale Frontend Web Applications
Wrangling Large Scale Frontend Web Applications
Ryan Roemer
 
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 ...
The Frontend Developer Landscape Explained and the Rise of Advanced Frontend ...
Prasid Pathak
 

Viewers also liked (20)

Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015Front End Tooling and Performance - Codeaholics HK 2015
Front End Tooling and Performance - Codeaholics HK 2015
 
Frontend automation and stability
Frontend automation and stabilityFrontend automation and stability
Frontend automation and stability
 
Sinau Bareng Frontend Web Development @ DiLo Malang
Sinau Bareng Frontend Web Development @ DiLo MalangSinau Bareng Frontend Web Development @ DiLo Malang
Sinau Bareng Frontend Web Development @ DiLo Malang
 
Webinar: Front End Web Development - Trendy Web Designs Using HTML5
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
 
User eXperience & Front End Development
User eXperience & Front End DevelopmentUser eXperience & Front End Development
User eXperience & Front End Development
 
Front end Tips Tricks & Tools
Front end Tips Tricks & ToolsFront end Tips Tricks & Tools
Front end Tips Tricks & Tools
 
Architecting your Frontend
Architecting your FrontendArchitecting your Frontend
Architecting your Frontend
 
Grunt js for the Enterprise Vol.1: Frontend Performance with Phantomas
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
 
建立前端开发团队 (Front-end Development Environment)
建立前端开发团队 (Front-end Development Environment)建立前端开发团队 (Front-end Development Environment)
建立前端开发团队 (Front-end Development Environment)
 
Wrangling Large Scale Frontend Web Applications
Wrangling Large Scale Frontend Web ApplicationsWrangling Large Scale Frontend Web Applications
Wrangling Large Scale Frontend Web Applications
 
A modern front end development workflow for Magnolia at Atlassian
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
 
Frontend technologies
Frontend technologiesFrontend technologies
Frontend technologies
 
How to Build Front-End Web Apps that Scale - FutureJS
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
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
 
Frontend at Scale - The Tumblr Story
Frontend at Scale - The Tumblr StoryFrontend at Scale - The Tumblr Story
Frontend at Scale - The Tumblr Story
 
Modern Frontend Technology
Modern Frontend TechnologyModern Frontend Technology
Modern Frontend Technology
 
TechTalk #85 : Latest Frontend Technologies
TechTalk #85 : Latest Frontend TechnologiesTechTalk #85 : Latest Frontend Technologies
TechTalk #85 : Latest Frontend Technologies
 
Front End Development Workflow Tools
Front End Development Workflow ToolsFront End Development Workflow Tools
Front End Development Workflow Tools
 
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 ...
The Frontend Developer Landscape Explained and the Rise of Advanced Frontend ...
 
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?
engage 2015 - Domino App Development - Where should I go now?
 

Similar to Frontend SPOF

Behat Workshop at WeLovePHP
Behat Workshop at WeLovePHPBehat Workshop at WeLovePHP
Behat Workshop at WeLovePHP
Marcos Quesada
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
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 Sauer
 

Similar to Frontend SPOF (20)

Preconnect, prefetch, prerender...
Preconnect, prefetch, prerender...Preconnect, prefetch, prerender...
Preconnect, prefetch, prerender...
 
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...
Google I/O 2012 - Protecting your user experience while integrating 3rd party...
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
 
20 tips for website performance
20 tips for website performance20 tips for website performance
20 tips for website performance
 
Scraping the web with Laravel, Dusk, Docker, and PHP
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
 
Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)Mobile backends with Google Cloud Platform (MBLTDev'14)
Mobile backends with Google Cloud Platform (MBLTDev'14)
 
Behat Workshop at WeLovePHP
Behat Workshop at WeLovePHPBehat Workshop at WeLovePHP
Behat Workshop at WeLovePHP
 
Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript
 
Web Development in Django
Web Development in DjangoWeb Development in Django
Web Development in Django
 
YouTube Mobile Webapp: On the edge of Html5
YouTube Mobile Webapp: On the edge of Html5YouTube Mobile Webapp: On the edge of Html5
YouTube Mobile Webapp: On the edge of Html5
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
Detecting headless browsers
Detecting headless browsersDetecting headless browsers
Detecting headless browsers
 
Velocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and youVelocity EU 2012 - Third party scripts and you
Velocity EU 2012 - Third party scripts and you
 
Google Chronicles: Analytics And Chrome
Google Chronicles: Analytics And ChromeGoogle Chronicles: Analytics And Chrome
Google Chronicles: Analytics And Chrome
 
Shining a light on performance (js meetup)
Shining a light on performance (js meetup)Shining a light on performance (js meetup)
Shining a light on performance (js meetup)
 
Zagat.com Case Study (DrupalCon Denver 2012)
Zagat.com Case Study (DrupalCon Denver 2012)Zagat.com Case Study (DrupalCon Denver 2012)
Zagat.com Case Study (DrupalCon Denver 2012)
 
DevOops & How I hacked you DevopsDays DC June 2015
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
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
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
 
vodQA Pune (2019) - Browser automation using dev tools
vodQA Pune (2019) - Browser automation using dev toolsvodQA Pune (2019) - Browser automation using dev tools
vodQA Pune (2019) - Browser automation using dev tools
 
WebPagetest Power Users - Velocity 2014
WebPagetest Power Users - Velocity 2014WebPagetest Power Users - Velocity 2014
WebPagetest Power Users - Velocity 2014
 

More from Patrick Meenan

Measuring the visual experience of website performance
Measuring the visual experience of website performanceMeasuring the visual experience of website performance
Measuring the visual experience of website performance
Patrick Meenan
 

More from Patrick Meenan (20)

Resource Prioritization
Resource PrioritizationResource Prioritization
Resource Prioritization
 
HTTP/2 Prioritization
HTTP/2 PrioritizationHTTP/2 Prioritization
HTTP/2 Prioritization
 
Getting the most out of WebPageTest
Getting the most out of WebPageTestGetting the most out of WebPageTest
Getting the most out of WebPageTest
 
Http2 in practice
Http2 in practiceHttp2 in practice
Http2 in practice
 
Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!
 
How fast is it?
How fast is it?How fast is it?
How fast is it?
 
Scaling Front-End Performance - Velocity 2016
Scaling Front-End Performance - Velocity 2016Scaling Front-End Performance - Velocity 2016
Scaling Front-End Performance - Velocity 2016
 
Machine Learning RUM - Velocity 2016
Machine Learning RUM - Velocity 2016Machine Learning RUM - Velocity 2016
Machine Learning RUM - Velocity 2016
 
TLS - 2016 Velocity Training
TLS - 2016 Velocity TrainingTLS - 2016 Velocity Training
TLS - 2016 Velocity Training
 
Service workers - Velocity 2016 Training
Service workers - Velocity 2016 TrainingService workers - Velocity 2016 Training
Service workers - Velocity 2016 Training
 
Front-End Single Point of Failure - Velocity 2016 Training
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
 
Measuring performance - Velocity 2016 Training
Measuring performance - Velocity 2016 TrainingMeasuring performance - Velocity 2016 Training
Measuring performance - Velocity 2016 Training
 
Service Workers for Performance
Service Workers for PerformanceService Workers for Performance
Service Workers for Performance
 
Velocity 2014 nyc WebPagetest private instances
Velocity 2014 nyc   WebPagetest private instancesVelocity 2014 nyc   WebPagetest private instances
Velocity 2014 nyc WebPagetest private instances
 
Mobile web performance - MoDev East
Mobile web performance - MoDev EastMobile web performance - MoDev East
Mobile web performance - MoDev East
 
Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013Tracking Performance - Velocity NYC 2013
Tracking Performance - Velocity NYC 2013
 
Image optimization
Image optimizationImage optimization
Image optimization
 
Measuring the visual experience of website performance
Measuring the visual experience of website performanceMeasuring the visual experience of website performance
Measuring the visual experience of website performance
 
Selecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutionsSelecting and deploying automated optimization solutions
Selecting and deploying automated optimization solutions
 
Velocity 2012 - Taming the Mobile Beast
Velocity 2012 - Taming the Mobile BeastVelocity 2012 - Taming the Mobile Beast
Velocity 2012 - Taming the Mobile Beast
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

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