Upgrade to Pro — share decks privately, control downloads, hide ads and more …

HTTP/2

 HTTP/2

Oursky Limited

August 28, 2015
Tweet

More Decks by Oursky Limited

Other Decks in Technology

Transcript

  1. What is HTTP/2 • RFC 7540 (May 2015) • binary

    framing protocol • share same semantics as HTTP/1.1 • using single TCP connection for all data • lower (perceived) latency • header compression
  2. Streams Stream 1
 DATA Client Server Stream 1
 HEADER HTTP/1.1

    Client Server Stream 1
 HEADER Stream 2
 HEADER Client Server Stream 2
 HEADER Stream 2
 DATA Client Server
  3. Streams Stream 1
 DATA Client Server Stream 1
 HEADER Stream

    2
 HEADER Stream 2
 DATA HTTP/2 Client Server Stream 1
 HEADER Stream 2
 HEADER
  4. Streams are multiplexed Stream 2
 HEADER Stream 1
 HEADER Stream

    1
 DATA Stream 1
 DATA Client Server Stream 2
 DATA HTTP/2 Client Server Stream 1
 HEADER Stream 2
 HEADER
  5. Streams are prioritised Stream 2
 HEADER Stream 1
 HEADER Stream

    1
 DATA Stream 1
 DATA Client Server Stream 2
 DATA HTTP/2 Client Server Stream 1
 HEADER Stream 2
 HEADER
  6. Benefits • Request multiple resources at the same time over

    the same connection • Having multiple connections (as in HTTP/1.1) will compete for bandwidth, hurting TCP performance • Prioritisation allows client to send all requests first and server figure out the order
  7. Server Push style.css
 HEADER index.html
 HEADER index.html
 DATA Client Server

    style.css
 DATA want
 index.html Client Server Oh! You need index.html,
 perhaps you need style.css as well! style.css
 DATA
  8. Benefits • Server send resources before client request them •

    Lower latency because no need to wait for client to figure out what sub-resources are needed • No need for resource inlining and concatenated resources • Reduce bandwidth too because server only send what is needed