Difference between HTTP/1.1 & HTTP/2

Vamsi K
2 min readNov 6, 2020

Before deep-diving into the difference between HTTP/1.1 & HTTP/2, let us understand what is this HTTP 🤔

HTTP:

The Hypertext Transfer Protocol is an application protocol that has been the de facto standard for communication on the World Wide Web since its invention in 1989.

HTTP/1.1:

Developed by Timothy Berners-Lee in 1989 as a communication standard for the World Wide Web, HTTP is a top-level application protocol that exchanges information between a client computer and a local or remote web server. In this process, a client sends a text-based request to a server by calling a method like GET or POST. In response, the server sends a resource like an HTML page back to the client.

HTTP/2:

HTTP/2 began as the SPDY protocol, developed primarily at Google with the intention of reducing web page load latency by using techniques such as compression, multiplexing, and prioritization. This protocol served as a template for HTTP/2 when the Hypertext Transfer Protocol working group https of the IETF (Internet Engineering Task Force) put the standard together, culminating in the publication of HTTP/2 in May 2015. From the beginning, many browsers supported this standardization effort, including Chrome, Opera, Internet Explorer, and Safari. Due in part to this browser support, there has been a significant adoption rate of the protocol since 2015, with especially high rates among new sites.

Let's jump into the differences between them:

SPEED:

HTTP/2 is faster than HTTP/1.1 on any given day by around 12-14%.

PROTOCOL:

HTTP/1.x uses text-based commands to complete HTTP requests. If you were to view one of these requests they would be perfectly readable (to a system admin at least).

HTTP/2, on the other hand, uses binary commands (1s and 0s) to complete HTTP requests. It needs to be converted back from binary to read the request.

STREAM PRIORITIZATION:

When websites load the assets (HTML, CSS, JavaScript, images) that make up the web page the order in which they are loaded is important. You can’t have CSS (the styling) load at the end; otherwise, the web page may look deformed for the first few seconds.

HTTP/1.1, this was easy, as head-of-line blocking made it simple to load various assets in the correct order.

HTTP/2, however, the response to the browser request may be received back in any order.

CONCLUSION:

HTTP/2 provides us with many new mechanics that will mitigate HTTP/1.1 issues and ones that will boost your web page performance. Currently, it is widely supported by web clients so its implementation is painless.

Although the implementation of HTTP/2 protocol is easy you should have in mind that with it you will probably have to change the mechanics (like serving assets to the client) to use the full potential of this protocol.

--

--