Don't Let Third Parties Slow You Down Arvind Jain, Michael Kleber Google.

Slides:



Advertisements
Similar presentations
Building Fast 3rd-Party Webapps O'Reilly Velocity Web Performance and Operations Conference 24 June Lessons.
Advertisements

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
Stevesouders.com/docs/sfjs pptx Disclaimer: This content does not necessarily reflect the opinions of my employer.
6/10/2015Cookies1 What are Cookies? 6/10/2015Cookies2 How did they do that?
AJAX Presented by: Dickson Fu Dimas Ariawan Niels Andreassen Ryan Dial Jordan Nielson CMPUT 410 University of Alberta 2006.
WHAT IS AJAX? Zack Sheppard [zts2101] WHIM April 19, 2011.
CM143 - Web Week 2 Basic HTML. Links and Image Tags.
Analysis and Performance Information Systems 337 Prof. Harry Plantinga.
High Performance Websites (Based on Steve Souder’s lecture) By Bhoomi Patel.
1 JavaScript & AJAX CS , Spring JavaScript.
Mark Phillip markphillip.com 200s, 304s, Expires Headers, HTTP Compression, And You.
Forms, Validation Week 7 INFM 603. Announcements Try placing today’s example in htdocs (XAMPP). This will allow you to execute examples that rely on PHP.
Performance, SEO, Accessibility Ivan Zhekov Telerik Corporation
Presented by…. Group 2 1. Programming language 2Introduction.
ASP.NET AJAX. Content ASP.NET AJAX Ajax Control Toolkit Muzaffer DOĞAN - Anadolu University2.
Computer Concepts 2014 Chapter 7 The Web and .
Javascript and the Web Whys and Hows of Javascript.
Ajax (Asynchronous JavaScript and XML). AJAX  Enable asynchronous communication between a web client and a server.  A client is not blocked when an.
JavaScript & jQuery the missing manual Chapter 11
11/13/2007 A synchronous J avaScript A nd X ML Gloria Law Joshua Mahaz.
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
Basic Responsive Design Techniques. Let’s take a look at this basic layout. It has a header and two columns of text, in a box that is centered on the.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Intro to Ajax Fred Stluka Jan 25, /25/2006Intro to AjaxFred Stluka2 What is Ajax? "Asynchronous JavaScript and XML" New name for an old technique:
JQUERY | INTRODUCTION. jQuery  Open source JavaScript library  Simplifies the interactions between  HTML document, or the Document Object Model (DOM),
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
1 Tradedoubler & Mobile Mobile web & app tracking technical overview.
1 Approaches for Asynchronous Communication in Web Applications Stefan Potthast and Mike Rowe.
Lecture # 6 Forms, Widgets and Event Handling. Today Questions: From notes/reading/life? Share Personal Web Page (if not too personal) 1.Introduce: How.
Copyright 2007, Information Builders. Slide 1 Understanding Basic HTML Amanda Regan Technical Director June, 2008.
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
audio video object Options: controls autoplay Need to define height and width Options: controls autoplay.
Fall 2006 Florida Atlantic University Department of Computer Science & Engineering COP 4814 – Web Services Dr. Roy Levow Part 2 – Ajax Fundamentals.
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
Ajax. –Asynchronous JavaScript and XML –Umbrella term for technologies that often: Use client-side scripting for layout and formatting Use less than full.
Asynchronous Javascript And XML AJAX : an introduction UFCEUS-20-2 : Web Programming.
PERFORMANCE ENHANCEMENT IN ASP.NET By Hassan Tariq Session #1.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
the acronym for Asynchronous JavaScript and XML.
Web Technologies Lecture 7 Synchronous vs. asynchronous.
 AJAX technology  Rich User Experience  Characteristics  Real live examples  JavaScript and AJAX  Web application workflow model – synchronous vs.
IN THIS LESSON WE WILL REVIEW THE STRUCTURE OF THE INTERNET AND HOW BROWSERS ASSEMBLE WEBSITES BASED ON INSTRUCTIONS THEY RECEIVE FROM SERVERS. Internet.
THE FUTURE IS HERE: APPLICATION- AWARE CACHING BY ASHOK ANAND.
Introduction to Node.js® Jitendra Kumar Patel Saturday, January 31, 2015.
Open Solutions for a Changing World™ Eddy Kleinjan Copyright 2005, Data Access WordwideNew Techniques for Building Web Applications June 6-9, 2005 Key.
Node.Js Server Side Javascript
CSE 154 Lecture 11: AJAx.
Not a Language but a series of techniques
Ad-blocker circumvention System
Data Virtualization Tutorial… CORS and CIS
AJAX – Asynchronous JavaScript and XML
Application with Cross-Platform GUI
AJAX.
Chrome Developer Tools
Preconnect, prefetch, prerender ...
Whether you decide to use hidden frames or XMLHttp, there are several things you'll need to consider when building an Ajax application. Expanding the role.
AJAX.
Node.Js Server Side Javascript
Introduction to JavaScript
MVC Framework, in general.
CSE 154 Lecture 11: AJAx.
AMP.
A second look at JavaScript
CSE 154 Lecture 22: AJAX.
Introduction to JavaScript
AJAX CS-422 Dick Steflik.
Intro to Ajax Fred Stluka Jan 25, 2006.
Lecture 34: Testing II April 24, 2017 Selenium testing script 7/7/2019
Presentation transcript:

Don't Let Third Parties Slow You Down Arvind Jain, Michael Kleber Google

Web is slow Average page load time: 4.9s Pages are complex: on average, 44 resources from 7 domains, and 320KB A lot of what's loaded is third party content o Digg o Facebook Connect o Twitter o Tribal Fusion o Yahoo Widgets o GlamMedia o DoubleClick, AdSense,...

Typical Example: Digg Widget digg_id = ‘digg-widget-container’; //make this id unique for each widget you put on a single page. digg_title = ‘Top 10 list from Technology’; snippet code as of Feb 23, 2010 Impact: 9 HTTP requests, 52 kB transferred over the wire. scripts block the main page’s content from downloading stylesheet blocks the main page from rendering in IE.

Latency Impact: Knockout Lab Load some publisher pages with and without third party content Testing our own code's effect on top 100 publishers' latency: AdSense: Responsible for 12.8% of pageload time Analytics: < 5% (before launch of the asynchronous GA snippet)‏ Doubleclick: 11.5% Our internal measurements of some other snippets:

Making Google AdSense Fast By Default

The Problem google_ad_width=300; google_ad_height=250; <script src="

The Goal Minimize Time Blocking the Publisher Page No retagging! Put the ad right here: Must run in publisher domain

Our Solution: ASWIFT –Make show_ads.js a tiny loader script –Loader creates a same-domain iframe –Loads the rest of show_ads into the iframe by document.write() of a tag. Asynchronous Script Written into IFrame Tag

Our Solution: ASWIFT var adsHtml = ' google_ad_width=300;... '; document.write(' '); var idoc = document.getElementById('foo'). contentWindow.document; idoc.open(); idoc.write(adsHtml);

Results Old show_ads.js47 ms288 ms ASWIFT11 ms32 ms Time spent blocking the page, once the script has loaded. median90th %ile

Browser-specific Surprises Parallel downloads of same script in IE Iframe creation inside in Firefox Request headers in Chrome Forward-Back-Reload behavior

Browser-specific Surprises Parallel downloads of same script in IE Some web pages have multiple ad blocks on them. If you use this technique in multiple iframes at the same time, IE seems to sometimes abort a second frame's fetch when the fetch for the first frame completes. We handle this by serializing the fetches, only doing it in one iframe at a time.

Browser-specific Surprises Iframe creation inside in Firefox In Firefox, when you document.write an tag from, there's no way to get a handle on the DOM object until. In this case, we don't use this technique.

Browser-specific Surprises Request headers in Chrome Chrome developer tools showed malformed HTTP headers on the requests inside the iframes. Fortunately, wireshark showed that the requests were fine; the dev tools were reporting incorrectly. (Whew.)‏

Browser-specific Surprises Forward-Back-Reload behavior When a user reloads a web page, this technique causes some browsers to reissue the request created by the show_ads_impl javascript. (The JS doesn't rerun; the URL it generated the first time is reloaded.) Be warned, since this behavior might be different than what happened before.