HTTP 2
HTTP/2 can make our applications faster, simpler, and more robust.
Goalsβ
The primary goals for HTTP/2 are to:
- π Reduce latency by enabling full request and response multiplexing.
- ποΈ Minimize protocol overhead via efficient compression of HTTP header fields.
- ποΈ Request prioritization
- π Server push
HTTP/2 does not modify the application semantics of HTTP in any way. All the core concepts, such as HTTP methods, status codes, URIs, and header fields, remain in place.
ποΈ Instead, HTTP/2 modifies how the data is formatted and transported between the client and server. New Binary Framing Layer
Binary Framing Layerβ
π Request and Response Multiplexingβ
With HTTP/1.1, if the client wants to make multiple parallel requests to improve performance, then multiple TCP connections must be used. This workaround was applied because of the HTTP/1.1 delivery model π, which ensures that only one response can be delivered at a time (response queuing [πΆπΆπΆπΆ]) per connection. This delivery model also results in π§ head-of-line blocking and inefficient use of the underlying TCP connection (cuz multiple connections are used).
ποΈ The new binary framing layer in HTTP/2 removes these limitations π©, and enables full request and response multiplexing, by allowing the client and server to:
- βοΈ break down an HTTP message into independent frames
- interleave them
- ποΈ reassemble them on the other end
The above image captures multiple streams within the same connection:
- The client is transmitting a DATA frame to the server
- The server is transmitting an interleaved sequence of frames to the client.