Http/2 lightning

Post on 09-Jan-2017

413 views 0 download

transcript

HTTP/2

The (not so) new Language of the Web

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

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

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

Current Browser Implementation

Binary Framing● Similar to TCP packets● Frames contain distinct

data (headers, payload, etc)

● Frames are indexed● Fixed length

Length

Flags

Identifier

Payload

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

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

by Ilya Grigorik

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

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

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

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

Transition Plan

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

Transition Strategies● Sit and wait

● Adopt HTTP/2 completely

● Hybrid approach

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

Thank You!