HTTP/2

 HTTP/2

975ff6c8166f6f32889f004a904ffa39?s=128

Oursky Limited

August 28, 2015
Tweet

Transcript

  1. 1.
  2. 2.

    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
  3. 3.
  4. 4.
  5. 7.
  6. 8.

    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
  7. 9.

    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
  8. 10.

    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
  9. 11.

    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
  10. 12.

    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
  11. 13.

    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
  12. 14.

    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
  13. 16.
  14. 18.
  15. 19.