HTTP2

HTTP 2 redefines the message. In HTTP1, the message looks like:

GET /index.html HTTP/1.1

Host: www.example.com


HTTP redefines the message. Following are the concepts:

  1. Stream

  2. Message

  3. Frames

Stream is Request and Response. Each stream has a unique id. One Stream will have one or more messages (e.g. Request Message and response message).

Message is aregular HTTP1 message (request/response), but they have a unique steam id. The reason is Server Push. A server can push more than one response message for a request message with the same stream id.

Messages are divided into frames. Frames are the smallest unit of transfer. That makes multiplexing possible. The identifying tags in frames allow the connection to interleave these frames during transfer and reassemble them at the other end.

The below diagram explains it:

https://developers.google.com/web/fundamentals/performance/http2



Benefits of HTTP2:

Note: Opening a TCP connection is expensive due to handshake and due to slower optimiza


  1. Performance

With the help of multiplexing. With HTTP/1.x, if the client wants to make multiple parallel requests to improve performance, then multiple TCP connections must be used