wimleers.com — Wim Leers — @wimleers
Fast internet connection ⇏ fast browsing
WPO = Web Performance Optimization
Full stack!
initcwnd
<script async>
Internet: evolving organism, accelerated by end-to-end principle
Expires
/Cache-Control
headersfoo.css
+ bar.css
= a54d9f.css
data:
URIsborder-radius
, no images … but IE8? (caniuse.com/border-radius)… and so much more!
localStorage
& application cacheinitcwnd
configuration… turned out to be great timing …
Make Drupal faster by integrating it with a CDN
⇓
Development vs. production
var t = performance.timing;
var htmlRenderTime = t.responseStart - t.requestStart;
var htmlDownloadTime = t.responseEnd - t.responseStart;
var usesRedirect = (t.redirectEnd - t.redirectStart) > 0;
var timeToFirstByte = t.responseStart - t.navigationStart;
var timeToFirstPaint = t.domInteractive - t.navigationStart;
Delay (s) | User reaction |
---|---|
0–0.1 | Instant |
0.1–0.3 | Feels sluggish |
0.3–1 | Machine is working… |
>1 | Mental context switch |
>10 | I'll come back later … maybe |
Most important overall measure, not the only one!
AKA:
Make Drupal faster by integrating it with a CDN
⇓
<1s, but depends on: page complexity, location, device …
Collecting the data is only 10% of the work.
Understanding it is much more difficult!
↓
data mining
Automatically pinpoint causes of slow pages via data mining.
example.com/fancy-page
's CSS
episode is slow"example.com
's JS
episode is slow for IE 8 & 9 users."example.com/some-page
is slow in Belgium"example.com/gallery
's loadCarousel
episode is slow in Belgium for Firefox 3 users"As tracked by Google Analytics — April 2012
As tracked by Google Analytics — April 2012
As tracked by Google Analytics — April 2012
Open Dev Tools, look at timeline
Look at headers of a specific resource
Network Utilization & Web Page Performance audits
CSS selector profiling (applied to these slides).
Lots of settings.
Pretty fast: ±1 second in Belgium
… but only in Belgium.
53 requests, 618 KB, 613 ms DOMready, 919 ms onload
iPhone 4, iOS 5, Cambridge MA, U.S.A.
Optimized images, aggregated JS, JS to bottom, expiration headers, gzipping, use CDN.
45 requests, 376 KB, 155 ms DOMready, 464 ms onload
iPhone 4, iOS 5, Cambridge MA, U.S.A.
11 requests, 274 KB, 107 ms DOMready, 595 ms onload
google.be/blank.html
— detect capturing proxies?google.be?rs=<hash>
— 171 KB worth of logic in JS! (Split payload.)10 requests, 83.6 KB, 96 ms DOMready, 188 ms onload