In this article we will see the main features for Http/2 specification. Till Http/1 the request and response processing between the client and server is simplex. That is, the client sends the request and server processes that , sends response back to the client. Then, client sends another request to server. If any of the request is blocked, then all other requests will have the performance impact. This biggest issue is tackled by introducing the request pipeline in Http/1.1. As part of request pipeline, the request will be sent in an order to the server. Server processes the multiple requests and sends the response back to the client in the same order. Again here the client and server communication is simplex. The below diagram depicts the client server communication happening with Http/1.0 and Http/1.1.
Till Http/1.1 the request and response are composed in text format and uses multiple TCP connections per origin. The issues like opening multiple TCP connections per origin, Text format, simplex communication is handled in Http/ 2. Now we will see how Http 2 processes request and responses.
The Http/2 uses binary protocol to exchange the data. Http/2 opens single connection per origin and the same TCP connection is used to process multiple requests. Each request will be associated to a stream and the request will be divided into multiple frames. Each frame will have the stream identifier to which it belongs to. The client will send multiple frames belongs to multiple streams to the server asynchronously and the server will process the frames belongs to multiple streams and sends the response asynchronously to the client. The client will arrange the response based on the stream identifier. Here the communication is happening between the client and server simultaneously with out blocking.
Another Http/2 feature is server push. When client requests for a resource from server, it pushes the additional resources along with the requested resources to the client to cache the data at the client side. This enhances the performance as the client cache is warmed up by the content.
To know further about Http/2 go through the below links.