7. Req / Res on HTTP/1.1
Text Base Protocol
GET /index.html HTTP/1.1
Host: example.org
Accept: text/html
CLIENT
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 35
<!DOCTYPE html>
<title>hello</title>
SERVER
8. HTTP ?
● Simple
○ text base, easy scaling etc
○ good for document sharing
○ but Good for Now ?
● now “Web” is
○
○
○
○
Plat Form (not only document sharing)
Ajax, WebSocket…
tons of JS, CSS, Images...
PC, Mobile, Tablet, TV, Game …
● needs
○ more speed
○ more efficiency
○ more secure
14. Starting HTTP2.0 (1/2 step)
● “http://”
○ Upgrade Header like websocket
● “https://”
○ ALPN (application layer protocol negotiation)
○ not NPN like spdy
● Known Supported
○ prior knowledge from DNS or so
○ may immediately send http2.0 frame
16. Starting HTTP2.0 (2/2 step)
● sending connection header
○ make sure peer supports http2.0
○ with Magic Octets
505249202a20485454502f322e300d0a0d0a534d0d0a0d0a
invalid
Method PRI
PRI * HTTP/2.0
rnrn
SM
rnrn
2 new line
for parser
21. Server Push(2)
HEADERS (stream_id=1)
- END_STREAM
+ END_HEADERS
:status = 200
content-type = text/html
content-length = 33
CLIENT
Response
SERVER
DATA
(stream_id=1)
+ END_STREAM
<html>
<img src=”a.png”>
</html>
cache hit !!
22. HPACK (header compression)
● HTTP Header
○ Text Base
○ Long Name
○ Send multiple time
● SPDY compression
○ CRIME
● HPACK
○ send diff
○ using binary
23. Static Header Table
Index
Header Name
1
:authority
2
:method
3
Header Value
...
...
51
refresh
GET
52
retry-after
:method
POST
53
server
4
:path
/
54
set-cookie
5
:path
/index.html
55
strict-transport-security
6
:scheme
http
56
transfer-encoding
7
:scheme
https
57
user-agent
8
:status
200
58
vary
9
:status
500
59
via
...
...
...
60
www-authenticate
...
33. books
● High Performance Browser Networking
○ by Ilya Grigorik(Google)
● Translate to Japanese ?
○ http://twitter.com/turky/status/406663190768914432