$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SPDY or maybe HTTP2.0
Search
Andreas Bjärlestam
February 23, 2012
Technology
4
64
SPDY or maybe HTTP2.0
An introduction to the SPDY protocol
Andreas Bjärlestam
February 23, 2012
Tweet
Share
More Decks by Andreas Bjärlestam
See All by Andreas Bjärlestam
Climate compensate with a pull request
bjarlestam
0
34
Agile performance testing
bjarlestam
0
110
SPDY and HTTP2
bjarlestam
1
1.2k
jquery mobile
bjarlestam
0
71
Devise - taking care of your users
bjarlestam
0
73
REST with JAX-RS
bjarlestam
1
91
REST
bjarlestam
2
170
Other Decks in Technology
See All in Technology
NIKKEI Tech Talk #41: セキュア・バイ・デザインからクラウド管理を考える
sekido
PRO
0
130
年間40件以上の登壇を続けて見えた「本当の発信力」/ 20251213 Masaki Okuda
shift_evolve
PRO
1
140
生成AI活用の型ハンズオン〜顧客課題起点で設計する7つのステップ
yushin_n
0
230
Snowflakeでデータ基盤を もう一度作り直すなら / rebuilding-data-platform-with-snowflake
pei0804
6
1.6k
RAG/Agent開発のアップデートまとめ
taka0709
0
180
生成AIを利用するだけでなく、投資できる組織へ / Becoming an Organization That Invests in GenAI
kaminashi
0
100
AI時代の新規LLMプロダクト開発: Findy Insightsを3ヶ月で立ち上げた舞台裏と振り返り
dakuon
0
190
AI駆動開発の実践とその未来
eltociear
0
120
品質のための共通認識
kakehashi
PRO
3
270
Reinforcement Fine-tuning 基礎〜実践まで
ch6noota
0
190
[デモです] NotebookLM で作ったスライドの例
kongmingstrap
0
160
コミューンのデータ分析AIエージェント「Community Sage」の紹介
fufufukakaka
0
510
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1032
470k
Optimizing for Happiness
mojombo
379
70k
Git: the NoSQL Database
bkeepers
PRO
432
66k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
390
Being A Developer After 40
akosma
91
590k
Navigating Team Friction
lara
191
16k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Writing Fast Ruby
sferik
630
62k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
A designer walks into a library…
pauljervisheath
210
24k
Transcript
Or maybe HTTP2.0 [SPeeDY] Andreas Bjärlestam! 2012-02-23!
SPDY quick overview • An evolu?on of HTTP
• Developed by Google since 2009 • Proprietary • But open
Why the hell would you want to replace HTTP?
HTTP is fantas?c it has totally changed the world
but…
HTTP 1.1 is 12 years old
Webpages in 1999
None
Webpages in 2012
None
Mobile internet usage source: svenskarna och internet 2011
hPps://www.iis.se/docs/SOI2011.pdf
This is how more and more of us consume
the web…
OSen it feels a lot like…
People no longer have pa?ence to wait for slow
pages
Web pages February 2012 • www.facebook.com -‐ ca 100
hPp requests • www.bostonglobe.com -‐ ca 100 hPp requests • www.svtplay.se -‐ ca 90 hPp requests • www.aSonbladet.se -‐ ca 350 hPp requests source: hPp://hPparchive.org/
What does it look like over the network fetching
100 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 op?miza?ons CSS sprites base64 images in data-‐urls
CSS concatena?on JavaScript concatena?on
HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP
HTTP/TCP 6 x HTTP connec?ons
What is the problem with this? Why not even
more?
TCP Conges?on control
Maximize throughput and Share network equally among
sessions
2 connec?ons per host recommended by HTTP 1.1 spec
6 connec?ons in most browsers
Domain sharding • www.bostonglobe.com -‐ 59 connec?ons •
www.svtplay.se -‐ 22 connec?ons • www.aSonbladet.se -‐ 118 connec?ons source: hPp://www.webpagetest.org
We kind of abuse TCP when we open more
connec?ons
and…
New TCP connec?ons are slow
3 way handshake
On my macbook Ping 20ms ≈ 30ms to set
up a connec?on On my mobile (3G) Ping 300ms ≈ 450ms to set up a connec?on
HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP HTTP/TCP
TCP Slow start HTTP/TCP
It turns out that page load ?me for a moderately
complex site is almost no faster over 20mbits/ sec than over 2mbits/sec
So… we need to u?lize our TCP connec?ons bePer
Enter
Don’t we break the web if we replace HTTP?
Nope
The seman?cs of HTTP is kept
Spdy implements HPpApi
You can switch to SPDY with no changes to
your web applica?on
HTTP -‐> SPDY GET PUT POST
… HEADERS Use of URIs Use of TCP GET PUT POST … HEADERS Use of URIs Use of TCP
SPDY runs over TCP and will not require upgraded
network equipment
HTTP -‐> SPDY TCP/IP TLS/SSL HTTP
TCP/IP TLS/SSL SPDY HTTP
Designed with speed as primary goal
1 TCP connec?on HTTP/TCP
HTTP/TCP But it will be on fire!
SPDY is mul?plexed
This is a typical HTTP session GET GET
GET 200 OK 200 OK 200 OK
Mul?plexing GET 1 GET 2 GET 3
200 OK 2 200 OK 3 200 OK 1
Stream priori?es
SPDY is binary
Will be difficult to just fire up telnet and
hack away
Every decent site will be encrypted and gzipped
anyways
TLS/SSL is mandatory
Communica?on should be secure by default Users
should not have to care
None
Using SSL ensures that communica?on over exis?ng proxies
is not broken
..but you will not be able to use proxies
for caching etc
Headers are compressed
A SPDY conversa?on
How will the client know that it can use
SPDY towards a server?
NPN TLS Next Protocol Nego?a?on
Server Push
Server Push
So is it worth it?
Google tested 25 of the “top 100” sites
Average speedup 39% -‐ 55%
SPDY could make your life easier • Less important
to concatenate JavaScripts • Less important to concatenate CSS files • Less need for CSS sprites • No need for domain sharding
Should I add SPDY support to my servers on
Monday?
Probably not…
Implementa?ons • mod_spdy • Nginx – in roadmap
• node_spdy – with special openssl build etc • express_spdy – with node 0.7 etc • nePy • more…
Browsers • Chrome (since version 6) • Firefox
11 (turned off by default) • (Amazon silk)
CDNs • Strangeloop • Contendo
CDNs SPDY Gateway Your web server
Browser
Google • Support SPDY on most of their services
• 90% of their SSL traffic is over SPDY
Amazon silk Silk Browser SPDY Gateway
The Internet SPDY HTTP
The spec • DraS spec, version 3 •
Plan is to submit it to IETF as input to HTTP2.0 • IETF HTTPbis WG chair recently proposed to start work on HTTP2.0
Cri?cism • Going over SSL means no proxies
• More difficult to debug since it is binary and compressed
Alterna?ves
HTTP Pipelining • Not as effec?ve as mul?plexing
• Hard to implement in browser • Opera is the only desktop browser that has a full implementa?on 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 Mul?plexing GET GET GET 200 OK 200 OK 200 OK Synchronous
Alterna?ve transport protocols • SCTP • BEEP
Roundup • ~ 50% Faster page loads than HTTP
• Backwards compa?ble with HTTP • BePer u?liza?on of TCP • Secured by default • Binary + compressed • Will likely be the base for HTTP2.0
APribu?ons • hPp://en.wikipedia.org/wiki/ File:US_Robo?cs_56K_Modem_Front.JPG • hPps://www.iis.se/docs/SOI2011.pdf •
hPp://www.flickr.com/photos/howi/6366423373/ • hPp://www.flickr.com/photos/wwarby/5110037138/ • hPp://www.flickr.com/photos/alicetragedy/ 4977295298/ • hPp://www.flickr.com/photos/koltregaskes/ 624914973/in/photostream/