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
SPDY and HTTP2
Search
Andreas Bjärlestam
March 15, 2013
Technology
1
1.2k
SPDY and HTTP2
Andreas Bjärlestam
March 15, 2013
Tweet
Share
More Decks by Andreas Bjärlestam
See All by Andreas Bjärlestam
Climate compensate with a pull request
bjarlestam
0
31
Agile performance testing
bjarlestam
0
110
SPDY or maybe HTTP2.0
bjarlestam
4
61
jquery mobile
bjarlestam
0
69
Devise - taking care of your users
bjarlestam
0
71
REST with JAX-RS
bjarlestam
1
89
REST
bjarlestam
2
170
Other Decks in Technology
See All in Technology
Clineを含めたAIエージェントを 大規模組織に導入し、投資対効果を考える / Introducing AI agents into your organization
i35_267
4
1.6k
解析の定理証明実践@Lean 4
dec9ue
0
180
GeminiとNotebookLMによる金融実務の業務革新
abenben
0
230
_第3回__AIxIoTビジネス共創ラボ紹介資料_20250617.pdf
iotcomjpadmin
0
150
生成AI時代の開発組織・技術・プロセス 〜 ログラスの挑戦と考察 〜
itohiro73
0
150
PHPでWebブラウザのレンダリングエンジンを実装する
dip_tech
PRO
0
200
Github Copilot エージェントモードで試してみた
ochtum
0
100
監視のこれまでとこれから/sakura monitoring seminar 2025
fujiwara3
11
3.9k
BrainPadプログラミングコンテスト記念LT会2025_社内イベント&問題解説
brainpadpr
1
160
Liquid Glass革新とSwiftUI/UIKit進化
fumiyasac0921
0
210
BigQuery Remote FunctionでLooker Studioをインタラクティブ化
cuebic9bic
3
290
より良いプロダクトの開発を目指して - 情報を中心としたプロダクト開発 #phpcon #phpcon2025
bengo4com
1
3.1k
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Being A Developer After 40
akosma
90
590k
Become a Pro
speakerdeck
PRO
28
5.4k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
490
VelocityConf: Rendering Performance Case Studies
addyosmani
330
24k
Gamification - CAS2011
davidbonilla
81
5.3k
Balancing Empowerment & Direction
lara
1
370
The World Runs on Bad Software
bkeepers
PRO
69
11k
Producing Creativity
orderedlist
PRO
346
40k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Automating Front-end Workflow
addyosmani
1370
200k
Transcript
HTTP/2.0 [SPeeDY] Andreas Bjärlestam (@bjarlestam)! 2013-03-15!
Something strange happened last year
You know HTTP?
It has been replaced!* *at several of the biggest
sites on the web
And no-‐one has noJced
Why the hell would you want to replace HTTP?
HTTP is fantasJc it has totally changed the world
but…
HTTP is over 20 years old HTTP 1.1 is
12 years old
Webpages in 1999
None
Webpages in 2013
None
Mobile internet usage source: svenskarna och internet 2012
hRps://www.iis.se/docs/SOI2012.pdf
This is how more and more of us consume
the web…
OTen it feels a lot like…
People no longer have paJence to wait for slow
pages
$peed Performance == $$
Being slow has a strong negaJve impact on business
The cost of being slow increases over Jme and persists
Myth: If your site loads in under 4 seconds
you are ok Actually: The negaJve impact of being slow increases linearly!
Bounce rate increases linearly with page load Jme
Search engines rank faster sites higher
Bandwidth doesn’t maRer much anymore Latency does
Bandwidth Page Load Time 1Mbps 3Mbps
9Mbps Latency Page Load Time 240ms 120ms 20ms
Web pages March 2013 • www.facebook.com -‐ ca 170
hRp requests • www.bostonglobe.com -‐ ca 150 hRp requests • www.svtplay.se -‐ ca 50 hRp requests • www.aTonbladet.se -‐ ca 450 hRp requests source: hRp://hRparchive.org/
What does it look like over the network fetching
150 resources?
None
Can you spot the problem?
Its all synchronous
How come an advanced page like facebook.com loads in
under 4 seconds when its all synchronous?
Hacky opJmizaJons CSS sprites base64 images in data-‐urls
CSS concatenaJon JavaScript concatenaJon
HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP
HTTP/TCP 6 x HTTP connecJons
Domain sharding • www.bostonglobe.com -‐ 25 domains •
www.svtplay.se -‐ 9 domains • www.aTonbladet.se -‐ 42 domains source: hRp://www.webpagetest.org
What is the problem with this? Why not even
more connecJons?
We kind of abuse TCP when we open more
connecJons
2 connecJons per host recommended by HTTP 1.1 spec
6 connecJons in most browsers
and…
New TCP connecJons are slow
3 way handshake
On my macbook Ping 20ms ≈ 30ms to set
up a connecJon On my mobile (3G) Ping 300ms ≈ 450ms to set up a connecJon
HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP
TCP Slow start HTTP/TCP
Window size 1 2 3 4 5 6 7
8 roundtrips TCP Slow start Packet loss
So… we need to uJlize our TCP connecJons beRer
Enter
Don’t we break the web if we replace HTTP?
Nope
The semanJcs of HTTP is kept
HTTP -‐> SPDY GET PUT POST
… HEADERS Use of URLs Use of TCP GET PUT POST … HEADERS Use of URLs Use of TCP
You can switch to SPDY with no changes to
your web applicaJon
Example…
Designed with speed as primary goal
1 TCP connecJon HTTP/TCP
HTTP/TCP But it will be on fire!
SPDY is mulJplexed
This is a typical HTTP session GET GET
GET 200 OK 200 OK 200 OK
MulJplexing GET 1 GET 2 GET 3
200 OK 2 200 OK 3 200 OK 1
Stream prioriJes
SPDY is binary
HTTP -‐> SPDY
Will be difficult to just fire up telnet and
hack away
Every decent site will be encrypted and gzipped
anyways
curl and wireshark will sJll be your friend
TLS/SSL is mandatory ✗
Simplest way to avoid problems with intermediaries
Headers are compressed
Server Push
Server Push
So is it worth it?
Many studies with slightly different results Most of
them indicate a significant speedup (10% – 60%) hRps://code.google.com/p/mod-‐spdy
SPDY could make your life easier No more hacky
opJmizaJons like CSS sprites, file concatenaJons, domain sharding etc
We need to unlearn some habits unshard
ImplementaJons • Apache mod_spdy • Nginx •
node_spdy • NeRy • JeRy • HAProxy • more…
Browsers • Chrome 6+ • Firefox 13+
• Opera 12.10+ • Amazon silk > 50% of browsers support SPDY
Google • Support SPDY on all their services (gmail
etc) • Most of their SSL traffic is over SPDY
Others • Akamai (Contendo) • Strangeloop •
F5 BIG-‐IP • TwiRer • Facebook • Wordpress • Amazon (kindle fire silkbrowser)
Amazon silk Silk Browser SPDY Gateway
The Internet SPDY HTTP Google has introduced a similar thing in chrome for android (beta version)
The spec • DraT spec, version 4 •
IETF has started to work on HTTP/2.0 • SPDY has been agreed to be the starJng point for HTTP/2.0
Roundup • Faster page loads than HTTP •
Backwards compaJble with HTTP • BeRer uJlizaJon of TCP • Secured by default • Binary + compressed
ARribuJons • hRp://en.wikipedia.org/wiki/ File:US_RoboJcs_56K_Modem_Front.JPG • hRps://www.iis.se/docs/SOI2012.pdf •
hRp://www.flickr.com/photos/howi/6366423373/ • hRp://www.flickr.com/photos/wwarby/5110037138/ • hRp://www.flickr.com/photos/alicetragedy/ 4977295298/ • hRp://www.flickr.com/photos/koltregaskes/ 624914973/in/photostream/
Backup slides
HTTP Pipelining • Not as effecJve as mulJplexing
• Hard to implement in browser • Opera is the only desktop browser that has a full implementaJon enabled by default • Android, IOS5 and Opera mobile browsers do some amount of pipelining • Not used by most proxies
Pipelining GET 1 GET 2 GET 3
200 OK 1 200 OK 2 200 OK 3 GET 1 GET 2 GET 3 200 OK 2 200 OK 3 200 OK 1 MulJplexing GET GET GET 200 OK 200 OK 200 OK Synchronous