This document summarizes a presentation on debugging front-end performance issues. It discusses identifying single points of failure from third-party scripts and social widgets that can block loading. It recommends monitoring for failures, loading scripts asynchronously, and using a "black hole" to simulate outages for testing. Detection and mitigation of blocking third-party code is important to ensure fast page loads.
3. Call directly from your back-end
Returns HTML to be injected directly into your page
echo file_get_contents(“http://social.patrickmeenan.com/gplus/?cookies=...”);
Implementation details:
• Synchronous and blocking
• Do not cache the results
• If you need to set a timeout, make sure it is at least 20 seconds, 45 preferred
• Include all cookies sent from the client
• May return javascript and set cookies
SOCIAL WIDGETS BACK-END API
10. • Server Monitoring
Base page responded in 0.160 seconds
• Full-Browser Monitoring
Page loaded in 25 seconds
• Analytics Page Views
Loaded and executed asynchronously
• Real User Monitoring Performance Reporting
No data if user bailed before onLoad
AND MONITORING SHOWS…
14. OVER THE LAST 3 YEARS
http://httparchive.org/trends.php
15. • Globally?
• Social sites tend to be targets for blocking
• platform.twitter.com
• connect.facebook.net
• apis.google.com
• HTTPS as well
• In an Enterprise?
• Corporate policies
BUT I’D NOTICE…
21. MOSTLY…
Desktop Browser OnLoad Blocked
Chrome Yes
Firefox Yes
Internet Explorer 9- No
Internet Explorer 10 Yes
Safari 5+ Yes
Opera Yes
Mobile Browser OnLoad Blocked
Android 2.x No
Android 4.x+ Yes
Chrome Mobile Yes
iOS 4 No
iOS 5+ Yes
IE Mobile 9 No
36. • Make sure your monitoring has aggressive time limits
(under 20 seconds)
• Make sure your real user monitoring has an aggressive
timeout
• Track real user failures by region
DETECTION
37. • Never load 3rd party resources synchronously
• refuse 3rd party code that doesn't have an async option
• Do not rely on onload for important functionality
• Service Workers (upcoming segment)
MITIGATION
38.
39. THANK YOU!
Tim Kadlec (@tkadlec) & Pat Meenan (@patmeenan)
June 20-21, 2016 at Velocity Conference (#velocityconf)
Icons courtesy of The Noun Project