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
730
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
omakaseしないための.rubocop.yml のつくりかた / How to Build Your .rubocop.yml to Avoid Omakase #kaigionrails
linkers_tech
3
340
マネジメント視点でのre:Invent参加 ~もしCEOがre:Inventに行ったら~
kojiasai
0
180
Kubernetes Summit 2024 Keynote:104 在 GitOps 大規模實踐中的甜蜜與苦澀
yaosiang
0
280
APIテスト自動化の勘所
yokawasa
6
3.1k
ABEMA のコンテンツ制作を最適化!生成 AI x クラウド映像編集システム / abema-ai-editor
cyberagentdevelopers
PRO
1
160
新卒1年目が挑む!生成AI × マルチエージェントで実現する次世代オンボーディング / operation-ai-onboarding
cyberagentdevelopers
PRO
0
110
年10万で社内Webアプリを10個動かす チャレンジをしている話 / The story of the challenge to run 10 in-house web apps for 100kJPY a year.
yamaguchitk333
0
110
品質の高い機能を”早く”提供するために技術的な面でチームでやったこと、やりたいこと
sansantech
PRO
2
270
よくわからんサービスについての問い合わせが来たときの強い味方 Amazon Q について
kazzpapa3
0
150
Figma Dev Modeで進化するデザインとエンジニアリングの協働 / figma-with-engineering
cyberagentdevelopers
PRO
1
380
内製化によるシステムモダナイゼーションの実践
kazokmr
3
540
Data Migration on Rails
ohbarye
7
4.8k
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
0
34
RailsConf 2023
tenderlove
29
870
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Code Reviewing Like a Champion
maltzj
519
39k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
41
2.1k
Building Better People: How to give real-time feedback that sticks.
wjessup
363
19k
Faster Mobile Websites
deanohume
304
30k
It's Worth the Effort
3n
183
27k
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