Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Building for performance and resilience
Search
Andy Hume
June 17, 2014
Technology
5
1.1k
Building for performance and resilience
Andy Hume
June 17, 2014
Tweet
Share
More Decks by Andy Hume
See All by Andy Hume
Architecting resilient front-ends, jQuery UK, 2015
andyhume
2
1.1k
Architecting resilient front ends
andyhume
3
790
Guardian Responsive Design, SmashingConf 2013
andyhume
6
590
Web Fonts as a Progressive Enhancement, Ampersand 2013
andyhume
2
740
Anatomy of a responsive page load, WhiskyWeb 2013
andyhume
10
1.8k
Breaking News & Breaking Software, SyncConf 2013
andyhume
0
240
Anatomy of a responsive page load, Responsive Day Out 2013
andyhume
23
3.3k
Responsive Guardian
andyhume
21
1k
CSS for grown ups: maturing best practises, SXSW 2012
andyhume
101
47k
Other Decks in Technology
See All in Technology
Lexical Analysis
shigashiyama
1
140
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
260
ジョブマッチングサービスにおける相互推薦システムの応用事例と課題
hakubishin3
3
650
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
12k
組み込みLinuxの時系列
puhitaku
4
1.1k
Going down the RAT hole: Deep dive into the Vuln-derland of APT-class RAT Tools
nttcom
0
240
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
1
110
いろんなものと両立する Kaggleの向き合い方
go5paopao
2
1.1k
3次元点群データ「VIRTUAL SHIZUOKA』のオープンデータ化による恩恵と協働の未来/FOSS4G Japan 2024
kazz24s
0
140
エンジニア候補者向け資料2024.11.07.pdf
macloud
0
4.6k
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
150
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
300
Featured
See All Featured
Faster Mobile Websites
deanohume
305
30k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
GitHub's CSS Performance
jonrohan
1030
460k
Visualization
eitanlees
145
15k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
7
570
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
GraphQLとの向き合い方2022年版
quramy
43
13k
How STYLIGHT went responsive
nonsquared
95
5.2k
Transcript
BUILDING FOR @andyhume SmashingConf, New York, 2014 PERFORMANCE RESILIENCE Tuesday,
June 17, 14
WHY CARE? http://www.strangeloopnetworks.com/resources/infographics/web-performance-and-ecommerce/ Tuesday, June 17, 14
WHY CARE? http://www.strangeloopnetworks.com/resources/infographics/web-performance-and-ecommerce/ Tuesday, June 17, 14
WHY CARE? http://www.strangeloopnetworks.com/resources/infographics/web-performance-and-ecommerce/ Tuesday, June 17, 14
WHY CARE? http://www.strangeloopnetworks.com/resources/infographics/web-performance-and-ecommerce/ Tuesday, June 17, 14
WHY CARE? http://www.strangeloopnetworks.com/resources/infographics/web-performance-and-ecommerce/ Tuesday, June 17, 14
WHY CARE? http://www.strangeloopnetworks.com/resources/infographics/web-performance-and-ecommerce/ Tuesday, June 17, 14
Measure http://www.flickr.com/photos/kayaker1204/4319542459/ Tuesday, June 17, 14
Measure http://www.flickr.com/photos/kayaker1204/4319542459/ We have a median page load me of
seven seconds, and our primary compe tor has a median page load me of three seconds. Tell a story Tuesday, June 17, 14
Measure http://www.flickr.com/photos/kayaker1204/4319542459/ Page load mes increased by 25% when we
added feature x. Tell a story Tuesday, June 17, 14
Your bosses love a story http://www.flickr.com/photos/kayaker1204/4319542459/ Tuesday, June 17, 14
Spread the word http://www.flickr.com/photos/kayaker1204/4319542459/ Tuesday, June 17, 14
What numbers?! http://www.flickr.com/photos/kayaker1204/4319542459/ Tuesday, June 17, 14
What numbers?! http://www.flickr.com/photos/kayaker1204/4319542459/ Page load time? Total download size? Start
render time? Time to first byte? Response time? Total HTTP requests? Document load time? Tuesday, June 17, 14
Tuesday, June 17, 14
Tuesday, June 17, 14
Tuesday, June 17, 14
Tuesday, June 17, 14
Tuesday, June 17, 14
Tuesday, June 17, 14
Tuesday, June 17, 14
Load Time First Byte Start Render Fully Loaded Speed Index
FIRST VIEW 3.783s 0.128s 0.676s 6.530s 1522 REPEAT VIEW 2.268s 0.486s 0.486s 3.617s 980 Tuesday, June 17, 14
Load Time First Byte Start Render Fully Loaded Speed Index
FIRST VIEW 3.783s 0.128s 0.676s 6.530s 1522 REPEAT VIEW 2.268s 0.486s 0.486s 3.617s 980 Tuesday, June 17, 14
Load Time First Byte Start Render Fully Loaded Speed Index
FIRST VIEW 3.783s 0.128s 0.676s 6.530s 1522 REPEAT VIEW 2.268s 0.486s 0.486s 3.617s 980 Tuesday, June 17, 14
Measure and tracking trends http://www.flickr.com/photos/kayaker1204/4319542459/ Tuesday, June 17, 14
SpeedCurve http://speedcurve.com Tuesday, June 17, 14
SpeedCurve http://speedcurve.com Tuesday, June 17, 14
How to optimize http://www.flickr.com/photos/freefoto/2231356418/ Tuesday, June 17, 14
Web performance 101 http://www.flickr.com/photos/freefoto/2231356418/ Content-Encoding: gzip Cache-Control: max-age=315360000 Tuesday, June
17, 14
Optimizing: First byte http://www.flickr.com/photos/freefoto/2231356418/ Load Time First Byte Start Render
Fully Loaded Speed Index FIRST VIEW 3.783s 0.128s 0.676s 6.530s 1522 REPEAT VIEW 2.268s 0.486s 0.486s 3.617s 980 Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp SSL Handshake Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp HTTP Redirect SSL Handshake Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp HTTP Redirect SSL Handshake Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp HTTP Redirect SSL Handshake Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp HTTP Redirect SSL Handshake Tuesday, June 17, 14
Optimizing: First byte DNS lookup TCP connect HTTP request Server
time HTTP resp HTTP Redirect SSL Handshake Tuesday, June 17, 14
Eliminate redirects Just eleminate redirects Flush the document early? Prefetch
DNS? But really, just eleminate redirects Optimizing: First byte Tuesday, June 17, 14
Optimizing: Start render http://www.flickr.com/photos/freefoto/2231356418/ Load Time First Byte Start Render
Fully Loaded Speed Index FIRST VIEW 3.783s 0.128s 0.676s 6.530s 1522 REPEAT VIEW 2.268s 0.486s 0.486s 3.617s 980 Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Remote JS Optimizing: Start render HTML parser DOM tree Layout
Paint Render tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
inline script waiting on remote CSS Optimizing: Start render HTML
parser DOM tree Layout Paint Render tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree fetching remote stylesheets Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree Tuesday, June 17, 14
Avoid blocking scripts Optimizing: Start render Tuesday, June 17, 14
Optimizing: Start render <script> var script = document.createElement('script'); script.src =
"app.js"; document.head.appendChild(script); </script> Tuesday, June 17, 14
Optimizing: Start render <script> var script = document.createElement('script'); script.src =
"app.js"; document.head.appendChild(script); </script> BREAKS THE PRE-PARSER! Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree HTML pre- parser Tuesday, June 17, 14
Remote JS Optimizing: Start render HTML parser DOM tree Layout
Paint Render tree HTML pre- parser Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree HTML pre- parser Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree HTML pre- parser fetching remote stylesheets Tuesday, June 17, 14
Optimizing: Start render HTML parser DOM tree Layout Paint Render
tree HTML pre- parser Tuesday, June 17, 14
Optimizing: Start render <script> var script = document.createElement('script'); script.src =
"app.js"; document.head.appendChild(script); </script> BREAKS THE PRE-PARSER! Tuesday, June 17, 14
Optimizing: Start render <script src="app.js" async defer></script> Tuesday, June 17,
14
Avoid blocking scripts Optimizing: Start render Move script elements to
end of <body> Or... add async attribute to script elements Inline critical CSS Tuesday, June 17, 14
Avoid blocking scripts Optimizing: Start render Move script elements to
end of <body> Or... add async attribute to script elements Inline critical CSS https://github.com/pocketjoso/penthouse Tuesday, June 17, 14
Optimizing: Load time fully loaded http://www.flickr.com/photos/freefoto/2231356418/ Load Time First Byte
Start Render Fully Loaded Speed Index FIRST VIEW 3.783s 0.128s 0.676s 6.530s 1522 REPEAT VIEW 2.268s 0.486s 0.486s 3.617s 980 Tuesday, June 17, 14
gzip compression (of course!) Far-future caching (of course!) Concatenate files
(of course!) Optimizing: Load time fully loaded Tuesday, June 17, 14
Optimizing: Speed Index http://www.flickr.com/photos/freefoto/2231356418/ Load Time First Byte Start Render
Fully Loaded Speed Index FIRST VIEW 3.783s 0.128s 0.676s 6.530s 1522 REPEAT VIEW 2.268s 0.486s 0.486s 3.617s 980 Tuesday, June 17, 14
http://www.flickr.com/photos/vpickering/6824364286/ Resilience Tuesday, June 17, 14
http://www.flickr.com/photos/the_jorr/325224175/ Unreliable Tuesday, June 17, 14
http://www.flickr.com/photos/8040811@N06/3167877765 Progressive enhancement th Tuesday, June 17, 14
The future http://www.flickr.com/photos/kayaker1204/4319542459/ Tuesday, June 17, 14
Future: HTTP/2 SPDY Tuesday, June 17, 14
Future: HTTP/2 SPDY Multiplexing Cache pushing Tuesday, June 17, 14
Future: ServiceWorker Tuesday, June 17, 14
Future: ServiceWorker this.addEventListener('fetch', function (e) { if (e.request.url.host === 'guardian.co.uk')
{ e.forwardTo('http://theguardian.com'); } } (Possibly not possible) Tuesday, June 17, 14
Future: ServiceWorker this.addEventListener('fetch', function (e) { if (window.innerWidth > 500)
{ e.forwardTo(e.request.url + '?width=large'); } } (Possibly not possible) Tuesday, June 17, 14
Experiment and measure http://www.flickr.com/photos/kayaker1204/4319542459/ Tuesday, June 17, 14
Experiment and measure http://www.flickr.com/photos/kayaker1204/4319542459/ Theorize Experiment, and... Measure Tuesday, June
17, 14
Thank-you! http://lanyrd.com/sdbmhb @andyhume Creative Commons Licensed Attribution, Non-Commercial, Share Alike
cc Tuesday, June 17, 14