This document discusses evaluating the performance of third-party scripts on websites. It begins by defining third-party scripts as anything served to the client from an external organization, not the website itself. Common types are then listed, with Google scripts comprising 71% of the top used scripts. The document goes on to discuss issues third-party scripts can cause including negative performance impacts, creating single points of failure, and privacy concerns. Potential solutions explored are using asynchronous loading, hosted libraries, and tools to monitor and measure third-party scripts.
7. #LDNWebPerf#webrebels
In the strictest sense, anything served to
the client that’s provided by an
organization that’s not the website
provider is considered to be third-party
“
”–Ben Vinegar, Author of “Third-Party Script”
What is a 3rd party script?
23. #webrebels
- John Hjelmstad
Google I/O 2012 (How we Make JavaScript Widgets Scream)
The value you get out of the widget needs to be
greater than the performance hit you are taking
Rule of Thumb
24. #webrebels
A user who has to endure an 8-second download delay
spends only 1% of their total viewing time looking at the featured
promotional space on a landing page.
In contrast, a user who receives instantaneous page rendering
spends 20% of viewing time within the promotional area
(source: Jakob Nielsen)
“
”
Perception of promotional space
31. #LDNWebPerf#webrebels
A single point of failure (SPOF) is a part of a
system that, if it fails, will stop the entire system
from working
–Wikipedia
SPOF
77. #LDNWebPerf#webrebels
Pages using Google CDN
(Top Alexa Websites)
0%
0.25%
0.5%
Jan '11 Jan '13 Jan '13 Jan '14 Jan '15
11%
17%
26%
37%
47%
Percentage
Google Hosted Libraries
PAGES USING GOOGLE
LIBRARIES API
52%
48%
82. #webrebels
Source: May 2015, Big Query result on jQuery from Google CDNs
Google’s hostest jQuery fragmentation
OTHER
30%
1.4.2
5%1.11.0
6%1.8.2
6%
1.11.1
7%
1.9.1
8%
1.8.3
8%
1.10.2
8%
1.7.1
10%
1.7.2
12%
98. #LDNWebPerf#webrebels
• Refuse 3rd party content that doesn’t provide async
options or is not minified
• Put the risk in the SLA (uptime etc.)
• Review jsmanners
• Educate other (junior) developers
• Test it via navigation and resource timing where applicable
What to do as a Publisher & Developer
99. #LDNWebPerf#webrebels
• Ask for server-side options
• Evaluate tag managers
• Investigate hosted libraries (if no own CDN is available)
• Monitor, monitor, ….and monitor
• Evaluate the need of the script with marketing and
sales
What to do as a Publisher & Developer
100. #LDNWebPerf#webrebels
What to do as a Script Provider
• Provide non-blocking code samples and snippets
• Educate developers, and verify the integration of
your script (proof-check)