HTTP/2 is a new protocol developed by Google to overcome issues faced in the HTTP/1.1 protocol. The primary goal of HTTP/2 is to reduce the latency and make applications faster, simpler, and robust. HTTP/2 protocol is able to address the latency issue which was earlier faced by HTTP/1.1 by
The difference between HTTP/1.1 and HTTP/2 is how the data is formatted and sent across the client and server. Apart from this, all the core concepts are the same as HTTP/1.1. Before understanding how HTTP/2 works, let's understand how HTTP/1.1 works.
HTTP/1.1 is a simple request and response system, which means you send a request, and you get a response. So following are the steps involved when a user opens a website:
Now when the browser parses the response from the server, it finds out there are more resources that are needed. What does the browser do? It opens a new TCP connection for the next resource. Imagine how long it would take for a browser to render a webpage if there are a large number of CSS or JS files.
To overcome this issue, browsers implemented a workaround that they open 6 simultaneous TCP connections. Even now if there are more than 6 resources that need to be loaded, the browser will have to wait.
The main problem with the HTTP/1.1 is the underutilization of TCP connection. A single TCP connection is capable of much more. Now we will see how HTTP/2 works.
HTTP/2 protocol addresses the issue of a single request in a single TCP connection. HTTP/2 utilizes TCP connection very efficiently.
In HTTP/2, a client can send as many requests as it wants at the same time in a single TCP connection which is also known as multiplexing. So when a browser finds out that it needs more resources to render the webpage, it sends requests for all the resources, and the server sends all the responses.
Now the question is how does the browser identify which response belongs to which request? The answer to which is the server tags the response with stream ID.
In HTTP/2, the data, as well as headers, are compressed. HTTP/2 comes with another cool feature know as server push.
This powerful feature of HTTP/2 allows a server to send multiple responses for a single request. This means when a client sends a request to the server and the server finds out that there are additional resources that might be needed (like CSS or JS files), it will push them to the client, without the client making any request for them.
HTTP/2 Checker is an online application/tool which helps you test if your website's server supports HTTP/2 protocol or not. Perform HTTP/2 test now and if your website does not already support HTTP/2 protocol, you should upgrade to HTTP/2 because you are missing out on a lot of benefits.
HTTP/2 makes your website load faster, and faster websites have better page speed, and hence you can improve your search result rankings if done right. Also do not forget to add server push support for your CSS and JS files. If you want to dive deeper into HTTP/2 workings you can read here.
This is another video resource, which will help you understand better about working of HTTP/2 protocol.