with HTTP 1?
HTTP 1 💪
HTTP/2 is binary
$ telnet google.com 80 Trying 18.104.22.168... Connected to google.com. Escape character is '^]'. GET HTTP/1.0 302 Found Cache-Control: private Content-Type: text/html; charset=UTF-8 Referrer-Policy: no-referrer Location: http://www.google.gr/?gfe_rd=cr&ei=paI6WcyoFpDIXru7o4AH Content-Length: 256 Date: Fri, 09 Jun 2017 13:29:09 GMT <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8"> <TITLE>302 Moved</TITLE></HEAD><BODY> <H1>302 Moved</H1> The document has moved <A HREF="http://www.google.gr/?gfe_rd=cr&ei=paI6WcyoFpDIXru7o4AH">here</A>. </BODY></HTML> Connection closed by foreign host.
This is HTTP/1.1, which is text based
Frames & Streams
* HTTP/2 req/res pairs are given unique stream IDs
* Messages passing through streams are called frames
* Frames have common headers across a stream
* There are various frame types: HEADERS, DATA, RST_STREAM, SETTINGS, PRIORITY
Sum = 16
Stream B: 4/16 = 1/4
Stream C: 12/16 = 3/4
* Stream B Priority: 4
* Stream C Priority: 12
=> Stream C will get three times the resources allocated to Stream B
Static Huffman encoding
Who uses it?
HTTP/2 is used by 14.6% of all the websites.
And as of April 13th, 2016, HTTP/2 traffic has now reached 68%. So in 6 months there has been a 17% increase in HTTP/2 traffic and adoption.