Http/2 lightning

18
HTTP/2 The (not so) new Language of the Web

Transcript of Http/2 lightning

Page 1: Http/2   lightning

HTTP/2

The (not so) new Language of the Web

Page 2: Http/2   lightning

Binary Protocol Features● Binary framing● Streams● Request & response multiplexing● Stream prioritization● Single connection per origin● Flow control● Server Push● Header Compression

Page 3: Http/2   lightning

The Final HTTP / 2 RFC(s)● Hypertext Transfer Protocol version 2 - RFC7540

○ Describes the new internals of the protocol○ Designed for low latency

● HPACK - Header Compression for HTTP/2 - RFC7541

● Published in May 2015

Page 4: Http/2   lightning

ImplementationsApache 2.4.17

F5 (upcoming release)

Jetty ~7.6.13

IIS Server 2016

Nginx 1.9.5

Akamai ~2015

cURL 7.38.0

WireShark 1.11

IE 11 (Windows 10 only)

Edge 2

Chrome 41

Firefox 36

Safari 9 (OSX 10.11+)

Opera 28

Page 5: Http/2   lightning

Current Browser Implementation

Page 6: Http/2   lightning

Binary Framing● Similar to TCP packets● Frames contain distinct

data (headers, payload, etc)

● Frames are indexed● Fixed length

Length

Flags

Identifier

Payload

Page 7: Http/2   lightning

Streams● Bidirectional flow of bytes within a connection● May carry one or more messages● Single TCP connection can carry several streams● Have identifiers● Can be prioritized

Page 9: Http/2   lightning

Capable of Multiplexing● Frames in different streams can be interleaved● Solves Head-of-Line blocking

by Ilya Grigorik

Page 10: Http/2   lightning

Header Compression● Original SPDY compression was vulnerable● HPACK used in HTTP/2● HPACK uses 2 compression techniques

○ Huffman compression○ Client & Server must keep indexed list of

previously seen headers

Page 12: Http/2   lightning

Server Push● Server knows content needed● Server sends a PUSH_PROMISE frame● Client can decide to accept frame or reset it● Currently still experimental

Page 13: Http/2   lightning

TLS Only● Not mandated by the standard● Chrome & Firefox stated they will not support

without TLS● Performance issues balanced in single

connection scenario● http://letsencrypt.org

Page 14: Http/2   lightning

Transition Plan● Know your application as it is● Which strategy is best for your customers● Optimizations you might need to change● Benchmark before & after every change● Deploy

Page 15: Http/2   lightning

Transition Plan

1. Internal / Backend APIs2. Public APIs3. CDNs4. Front end applications5. Load balancers & other proxies

Page 16: Http/2   lightning

Transition Strategies● Sit and wait

● Adopt HTTP/2 completely

● Hybrid approach

Page 17: Http/2   lightning

Resources● http://http2.github.io● High Performance Browser Networking -

http://bit.ly/1PWhBQ3● Google HTTP/2 podcasts - http://bit.ly/1QgUrUP● http://caniuse.com/#feat=http2● HTTP/2 is here, let’s optimize -

http://bit.ly/20KJq5I

Page 18: Http/2   lightning

Thank You!