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
The Glorious Era of HTTP/2
Search
Surma
March 21, 2016
Technology
1
82
The Glorious Era of HTTP/2
Chrome Dev Summit 2015
Surma
March 21, 2016
Tweet
Share
More Decks by Surma
See All by Surma
Know thy buzzwords: HTTP/2
surma
1
530
Houdini Breakout Session
surma
4
570
Houdini – Demystifying CSS
surma
3
300
Progressive Web Apps – Mobile has natively come to the Web
surma
5
280
Instant Loading
surma
4
1.2k
HTTP/2 101
surma
5
470
What if there isn’t?
surma
0
74
What if there isn’t?
surma
2
150
The Web is a Contender
surma
0
110
Other Decks in Technology
See All in Technology
小規模に始めるデータメッシュとデータガバナンスの実践
kimujun
3
390
AWS re:Inventを徹底的に楽しむためのTips / Tips for thoroughly enjoying AWS re:Invent
yuj1osm
0
320
Vueで Webコンポーネントを作って Reactで使う / 20241030-cloudsign-vuefes_after_night
bengo4com
3
2.3k
30万人が利用するチャットをFirebase Realtime DatabaseからActionCableへ移行する方法
ryosk7
2
300
Creating Intuitive Developer Tool in Swift
giginet
PRO
0
600
【LT】ソフトウェア産業は進化しているのか? -Javaの想い出とともに- #jjug_ccc
takabow
0
160
顧客が本当に必要だったもの - パフォーマンス改善編 / Make what is needed
soudai
21
6.1k
Hotwire光の道とStimulus
nay3
5
2.3k
WINTICKETアプリで実現した高可用性と高速リリースを支えるエコシステム / winticket-eco-system
cyberagentdevelopers
PRO
1
180
AI Builder について
miyakemito
1
140
Jr. Championsになって、強く連携しながらAWSをもっと使いたい!~AWSに対する期待と行動~
amixedcolor
0
110
いまならこう作りたい AWSコンテナ[本格]入門ハンズオン 〜2024年版 ハンズオンの構想〜
horsewin
5
880
Featured
See All Featured
A Tale of Four Properties
chriscoyier
156
23k
Become a Pro
speakerdeck
PRO
24
5k
Building Your Own Lightsaber
phodgson
102
6k
4 Signs Your Business is Dying
shpigford
180
21k
Gamification - CAS2011
davidbonilla
80
5k
How to Ace a Technical Interview
jacobian
275
23k
Measuring & Analyzing Core Web Vitals
bluesmoon
0
34
Designing the Hi-DPI Web
ddemaree
280
34k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
780
What's in a price? How to price your products and services
michaelherold
243
11k
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.6k
Transcript
None
HTTP2 101 Surma @surmair
TL;DR: SWITCH! HTTP/2 ≥ HTTP/1
TL;DR Performance If you invest, you can squeeze out lots
of Δt
History HTTP HTTP/0.9 HTTP/1.0 HTTP/1.1 SPDY/2 HTTP/2 1991 1995 1997
2012 2015
HTTP/0.9
History HTTP HTTP/0.9 HTTP/1.0 HTTP/1.1 SPDY/2 HTTP/2 1991 1996 1997
2012 2015
HTTP/0.9 GET POST HEAD PUT DELETE LINK UNLINK HTTP/1.0
History HTTP HTTP/0.9 HTTP/1.0 HTTP/1.1 SPDY/2 HTTP/2 1991 1996 1997
2012 2015
None
HTTP/1.x Best Practices Write it, concatenate it, minify it, inline
it, sprite it, shard it, vulcanize it, gzip it Workarounds Hacks
Flaw #1 HOL Blocking aka one-resource-at-a-time syndrome
http2.golang.org/gophertiles
None
h1 h2
Flaw #2 Meta Data GET /index.html User-Agent: Mozilla/5.0… Cookie: session_id=deadbeef
… POST /comment User-Agent: Mozilla/5.0… GET /logo.jpg User-Agent: Mozilla/5.0… GET /script.js User-Agent: Mozilla/5.0… Cookie: session_id=deadbeef …
Flaw #2 Meta Data 200 OK Set-Cookie: … Content-Type: text/html
Content-Encoding: gzip <compressed data> ?
History HTTP HTTP/0.9 HTTP/1.0 HTTP/1.1 SPDY/2 HTTP/2 1991 1996 1997
2012 2015
Welcome to the glorious era of ✨HTTP/2✨ …but what is
it?
HTTP/1.1 Upgrade to h2 ✨HTTP/2✨
✨HTTP/2✨ TLS encrypted
✨HTTP/2✨ Single TCP connection
✨HTTP/2✨
✨HTTP/2✨ Single TCP connection
HTTP/2 Concatenation Inlining Vulcanize Spriting
None
h1 h2
h1 h2
h2 h1
h2 capable h2 enabled h2 unsupported 7,200 ms 5,325 ms
6,160 ms Time to mobile load event Sample is 1 month of data on https://next.ft.com
✨HTTP/2✨
HPACK Header compression specifically for HTTP
✨HPACK✨ Header compression specifically for HTTP glorious
✨HPACK✨ 2 :method GET 3 :method POST 5 :path /index.html
8 :status 200 35 Host 61 www-authenticate 62 … … … GET /index.html Host: www.example.org 2, 5, 35, Huffman(“www.example.org”)
✨HPACK✨ 2 :method GET 3 :method POST 5 :path /index.html
8 :status 200 35 Host 61 www-authenticate 62 Host www.example.org … … … GET /index.html Host: www.example.org 2, 5, 35, Huffman(“www.example.org”)
✨HPACK✨ 2 :method GET 3 :method POST 5 :path /index.html
8 :status 200 35 Host 61 www-authenticate 62 Host www.example.org 63 … … POST /something Host: www.example.org 3, Huffman(“/something”), 62
HPACK Sharding Multiple CDNs
But wait theres more… Squeeze out the last bits of
performance
✨PUSH✨ Can I interest you in some complementary resources to
your resources?
✨PUSH✨ GET /index.html /index.html /style.css /script.js GET /style.css GET /script.js
None
with push without push Don’t push mindlessly!
Still needed GZIP/Deflate First Render CDNs/DNS lookup Cache-Control
47% of HTML 36% of CSS 26% of JS are
still uncompressed without gzip with gzip bit.ly/uncompressed-resources
Now?
Now? (browsers)
Now? (servers) ✔ ✔ ✔
Now? (languages) bit.ly/http2implementations
bit.ly/http2implementations
Now? github.com/GoogleChrome/simplehttp2server (local dev) HTTP/2 & Push
None
None
Now! Your Production Environment
Now! (Tier 1) Put your static assets on a h2
CDN
Now! (Tier 1) 8.41s vs 1.84s over 3G
Now! (Tier 1) 10% less data 0.15% faster
Now! (Tier 2) h2 reverse proxy
Now! (Tier 3) h2
Future? Manifest for static hosters and CDNs manifest.json
{ "index.html": { "/css/app.css": { "type": "style" }, ... },
"page.html": { "/css/page.css": { "type": "style" }, ... } }
$ http2-push-manifest -f index.html -f page.html
WebSockets – Maybe not a Thing Future?
Now? Yes Why? #PerfMatters How? JUST DO IT HTTP/2
Thank you! Surma @surmair