HTTP/1.1 vs. HTTP/2

hackbotone1 pts0 comments

http/1.1 vs http/2. Introduction | by Anshuman Pattnaik | MediumSitemapOpen in appSign up<br>Sign in

Medium Logo

Get app<br>Write

Search

Sign up<br>Sign in

Introduction<br>What is HTTP/1.1?<br>What is HTTP/2?<br>Head Of Line blocking in HTTP/1.1<br>HTTP/2 — Binary Framing Layer<br>HTTP/2 — Stream Prioritization<br>Resource Inlining vs Server Push<br>HTTP/1.1 — Resource Inlining<br>HTTP/2 — Server Push<br>Header Compression<br>HTTP/1.1 — gzip compression<br>HTTP/2 — HPACK Compression<br>Conclusions

http/1.1 vs http/2

Anshuman Pattnaik

12 min read·<br>Sep 18, 2022

Listen

Share

Press enter or click to view image in full size

Introduction<br>The HTTP or Hypertext Transfer Protocol is an application layer control protocol for transmitting hypermedia documents such as graphics, audio, video, plain text and hyperlinks on the World Wide Web. To obtain information from the target web server, the client makes a request and keeps the Connection open until it receives a response. HTTP is a stateless protocol that means the target server does not support information between two requests.<br>Since the evolvement of HTTP/1.1 in 1997, this version was the standardized communication protocol in RFC 2068 until the HTTP/2 protocol was introduced in 2015 by IETF (Internet Engineering Task Force). HTTP/2 protocol version was introduced to decrease latency, increase speed and enable complete request and response multiplexing, which means when the client opens a connection to the target web server, it can send multiple requests and receive multiple responses with a single line of communication.<br>Now, let’s dive deep into these two protocols and understand the main difference between HTTP/1.1 and HTTP/2 and the technical changes HTTP/2 has adopted in the modern World Wide Web.<br>What is HTTP/1.1?<br>In 1989 Timothy Berners Lee developed a communication protocol for the World Wide Web called Hypertext Transfer Protocol that exchanges data between a client and a remote web server. When a client visits a website on his browser, for example — www.google.com, it sends a request to the remote web server and waits until the server sends a response; in this communication, the server acknowledges it with an HTML page.<br>To send a particular request client calls methods like GET or POST, which later be interpreted by HTTP and processed to the remote web server.<br>GET /index.html HTTP/1.1<br>Host: www.google.comThe above HTTP request is an example of a GET method, and it requests the remote Host: to get the resources of www.google.com and the web server returns an HTML with all the necessary resources like CSS, js, images, etc. But all these contents are not returned to the client at once in a single request. To render the complete HTML page on the web browser, the client sends multiple requests to receive all the resources from the target web server; once the web browser receives all the resources, it displays the complete HTML web page on the screen.<br>What is HTTP/2?<br>HTTP/2 is a primary revision of HTTP/1.1 and derived from the SPDY protocol, which Google originally developed as a way to improve the web page loading performance by reducing the latency using the technique such as complete request and response multiplexing, efficient Compression of HTTP header fields, enabling request prioritization and server push.<br>The HTTP Working Group developed HTTP/2, also called as httpbis, of the Internet Engineering Task Force (IETF). The Working Group first presented the HTTP/2 protocol research to the Internet Engineering Steering Group (IESG) on December 2014, and later IESG approved it on February 17, 2015. The specification for HTTP/2 was published as RFC-7540 on May 14, 2015. The protocol is supported by many standardized browsers Chrome, Firefox, Safari, Opera and many more.<br>The architecture behind HTTP/2 is the binary framing layer which sends all the requests and responses in binary format and maintains HTTP semantics such as methods and headers. When the client makes a request using a high-level API, it still constructs the messages in traditional HTTP formats. Still, it’s essential to understand that all these messages are converted into binary at a low level. HTTP/2 version has many features and evolved significantly by transforming messages from plain text to binary, allowing this protocol to deliver the message faster and more efficiently.<br>As of now, we understand the typical difference between these two protocols and ensure that both protocols use the same HTTP semantics such as headers, methods and verbs. To send messages, HTTP/1.1 uses the plain text technique, and HTTP/2 transform the messages into binary. In the next section, we will briefly discuss how HTTP/1.1 uses different methods to send messages and what challenges occurred and were resolved by the HTTP/2 using the binary framing layer technique.<br>Head Of Line blocking in HTTP/1.1<br>In computer networking, Head-of-line blocking (HOL blocking) is a performance-limiting phenomenon that occurs when a group of packets are in the queue by...

http server protocol request client binary

Related Articles