Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
The Glorious Era of HTTP/2
Search
Surma
March 21, 2016
Technology
150
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
The Glorious Era of HTTP/2
Chrome Dev Summit 2015
Surma
March 21, 2016
Transcript
64 slides
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
More Decks by Surma
See All by Surma
Know thy buzzwords: HTTP/2
surma
1
600
Houdini Breakout Session
surma
4
730
Houdini – Demystifying CSS
surma
3
360
Progressive Web Apps – Mobile has natively come to the Web
surma
5
340
Instant Loading
surma
4
1.4k
HTTP/2 101
surma
5
550
What if there isn’t?
surma
0
130
What if there isn’t?
surma
2
230
The Web is a Contender
surma
0
180
Other Decks in Technology
See All in Technology
サーバーラックは作る時代! 3Dプリンターで作る10インチラックのススメ
jacopen
2
440
SSFの現在地 ― CAEP/RISCからAI Identityへ
oidfj
0
470
これからのデータエンジニアの役割について考える / Rethinking the Role of Data Engineers in the AI Era
okiyuki99
1
530
2026-11-11 Tamachi.sre#7 PaCにインフラリソースの命を救われました。 / PaC saves the infra resource life
masasuzu
1
200
DevOps Agentにあらゆるセキュリティインシデントのトリアージを任せた件
jirtosterone
1
180
変更差分を読むために環境を整備しよう
pipepasta
1
450
閉域網でのAPI公開の選択肢全部比較!
takano0131
3
510
並列度を下げたら速くなった — go build の重複コンパイルを実測で見る
tomoaki25
2
1.3k
仕様と現実の間で落とし所を探るリモートMCPの認証・認可 — Sansanの認証基盤における課題と実践
sansantech
PRO
2
350
速くなるほど、深く考える AI時代のQAに学ぶ
kobayashiyorimitsu
0
260
農家は秘伝のタレを知らない - NOBODY KNOWS THE HIDDEN SOURCE - Kaggriculture 3rd Place Solution
masspeaks
2
510
目を覚ませ!僕らの認証情報が何者かに侵略されてるぞ
tkito
2
450
Featured
See All Featured
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
540
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
590
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
360
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Raft: Consensus for Rubyists
vanstee
143
7.9k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
Code Review Best Practice
trishagee
74
20k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
490
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
570
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
530
Designing for humans not robots
tammielis
254
26k