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

HTTP/2

 HTTP/2

975ff6c8166f6f32889f004a904ffa39?s=128

Oursky Limited

August 28, 2015
Tweet

Transcript

  1. HTTP/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. None
  4. None
  5. Request HTTP/1.1 Response

  6. Request
 HEADERS frame HTTP/2 Response
 HEADERS frame Response
 DATA frame

  7. None
  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
  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
  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
  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
  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
  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
  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
  15. resource inlining concatenated
 resources

  16. None
  17. When can I have HTTP/2?

  18. None
  19. None