Simon Hearne - Web Performance Consultant
#perfmatters conf 2018
make something ๐ค
test it ๐
ship it ๐
...
put tags on it ๐ณ
we seem to have less control than ever
โWe know that Optimizely slows down the site, but it will get us $750k increased revenue this yearโ
Holiday website, UK
โWe suspect it slows the site down, we havenโt tested it. Marketing says itโs critical to their latest TV campaign so thereโs no point arguingโ
Budget airline, UK
โAll the tags go through the tag manager, so they should be fine.โ
Clicks-and-mortar store, UK
blog.ryankearney.com/2013/01/comcast-caught-intercepting-and-altering-your-web-traffic/
website tracking is a "security disaster waiting to happen"
๐
๐
help.optimizely.com/Account_Settings/Optimizely_support_plans
document.write("<div
class='vdb_player vdb_565ec775e4b092ebc9685ce853180f5de4b066208a63279a'
vdb_params='m.pub_id=606413&m.url=http://nypost.com/#1' - alert(1) - '-alert(1)-'>
</div>");
<script src="//s7.addthis.com/addthis_widget.js" async></script>
discuss.newrelic.com/t/do-not-clear-the-resource-timing-buffer/
... the X Web Reference Snippet was available ... and the download time over HTTP did not exceed 500 ms.
Snippet is sampled every minute from a variety of U.S. locations.
status.optimizely.com
orangevalley.nl/en/blog/9-ab-testing-tools-compared-on-site-speed-impact/
Top 250 resources from HTTP Archive
Top 250 resources from Akamai mPulse
https://www.w3.org/TR/resource-timing-1/
nicj.net/resourcetiming-visibility-third-party-scripts-ads-and-page-weight/
๐ no redirect information
๐ limited data on 72% of third-party content
๐ only the first 150 requests *
๐ no data on old iDevices
๐ no data for cross-origin iframes
developer.akamai.com/blog/2017/07/26/measuring-performance-third-party-contributors/
* limit can be increased per pageview
calendar.perfplanet.com/2017/an-audit-of-boomerangs-performance/
But there are things we can do...
github.com/simonhearne/thirdpartydb | thirdpartydb.appspot.com
Akamai mPulse
blog.catchpoint.com/2018/01/10/using-catchpoint-to-analyze-third-party-impact/
speedcurve.com/blog/ux-focus-for-waterfalls-and-third-parties/
Partner 1 = ~400ms slower than partner 2
Migrating all ads = 220ms faster page load
Additional revenue ~= $12,000 per month
Large US publishing company
"Everything should have a value,
because everything has a cost"
Tim Kadlec - freelance #webperf god
{
"csp-report": {
"document-uri": "https://yourwebsite.com/",
"referrer": "",
"violated-directive": "style-src",
"effective-directive": "style-src",
"original-policy": "",
"disposition": "enforce",
"blocked-uri": "inline",
"line-number": 4,
"column-number": 3,
"source-file": "https://static.hotjar.com/c/hotjar-730716.js?sv=6",
"status-code": 0,
"script-sample": ""
}
}
blog.catchpoint.com/2018/01/10/using-catchpoint-to-analyze-third-party-impact/
The
best way to monitor resources,
even with its limitations
Akamai mPulse
๐ CryptoJacking
๐ XSS
๐ Maintenance
<link
rel="stylesheet"
href="//maxcdn.bootstrapcdn.com/.../bootstrap.min.css"
integrity="
sha256-8EtRe6XWoFEEhWiaPkLaw...=
sha512-/5KWJw2mvMO2ZM5fndVxU...=
"
crossorigin="anonymous">
<script
src="//ajax.googleapis.com/.../jquery.min.js"
integrity="
sha256-ivk71nXhz9nsyFDoYoGf2...=
sha512-7aMbXH03HUs6zO1R+pLye...=
"
crossorigin="anonymous"></script>
๐ Malicious Code
๐ Untested Changes
๐ Maintenance
โญ๏ธ Signature-based Restrictions...*
function timeout(delay) {
return new Promise(function(resolve, reject) {
setTimeout(function(){
resolve(new Response('', {
status: 408,
statusText: 'Request timed out.'
}));
}, delay);
});
}
self.addEventListener('fetch', function(event) {
// Only fetch JavaScript files for now
if (/\.js$/.test(event.request.url)) {
event.respondWith(Promise.race([timeout(2000), fetch(event.request.url)]));
} else {
event.respondWith(fetch(event.request));
}
});
calendar.perfplanet.com/2015/reducing-single-point-of-failure-using-service-workers/
๐ CDN / Network outages
๐ Not on first pageview
๐ Maintenance
๐ You can break your site
๐ CDN / Network outages
๐ Shared TCP connection
๐ Maintenance
๐ดโ @SimonHearne
๐ webperf.ninja/tools
๐ฅ simonhearne.github.io/weak-links
@SimonHearne