DIFFERENCE BETWEEN HTTP1.1 VS HTTP 2.0

Mohammad Maaz
2 min readNov 3, 2020

--

HTTP-HYPERTEXT TRANSFER PROTOCOL.

HTTP is based on the Client/Server model. Client/Server model can be explained as Client (receiver of service) and Server (provider of service) that are communicating via requests and responses.

KEY DIFFERENCES:

HTTP/1.1, which keeps all requests and responses in plain text format, HTTP/2 uses the binary framing layer to encapsulate all messages in binary format, while still maintaining HTTP semantics, such as verbs, methods, and headers.

In HTTP/2, the binary framing layer encodes requests/responses and cuts them up into smaller packets of information, greatly increasing the flexibility of data transfer.

HTTP/2 is much faster and more efficient than HTTP/1.1. One of the ways in which HTTP/2 is faster is in how it prioritizes content during the loading process.

Developers can decide whatever they want to load first like text of a webpage loads first, or the CSS files, or the JavaScript, or whatever they feel is most important for the user experience.

Multiplexing: HTTP/1.1 loads resources one after the other, so if one resource cannot be loaded, it blocks all the other resources behind it. In contrast, HTTP/2 is able to use a single TCP connection to send multiple streams of data at once so that no one resource blocks any other resource. HTTP/2 does this by splitting data into binary-code messages and numbering these messages so that the client knows which stream each binary message belongs to.

Server push: Typically, a server only serves content to a client device if the client asks for it. However, this approach is not always practical for modern webpages, which often involve several dozen separate resources that the client must request. HTTP/2 solves this problem by allowing a server to “push” content to a client before the client asks for it. The server also sends a message letting the client know what pushed content to expect.

Header compression: Small files load more quickly than large ones. To speed up web performance, both HTTP/1.1 and HTTP/2 compress HTTP messages to make them smaller. However, HTTP/2 uses a more advanced compression method called HPACK that eliminates redundant information in HTTP header packets. This eliminates a few bytes from every HTTP packet. Given the volume of HTTP packets involved in loading even a single webpage, those bytes add up quickly, resulting in faster loading.

--

--

Mohammad Maaz
Mohammad Maaz

Written by Mohammad Maaz

0 Followers

Software Developer who aspires to add a value to society

No responses yet