Table of contents
Introduction
Thanks to the #DebuggingFeb Writeathon, I take this opportunity to do some research and write about some technical topics that made me think “Hey if you don’t learn this, you will be outdated on this topic because IT tech moves very fast!”. I guess it happens to everyone, this FOMO about tech news.
After the PlanetScale hackathon, I continued to receive some newsletters and one of them was talking about HTTP/3.0. So after the wave of web 3.0, maybe some people were “re”-creating everything in a 3.0 way. By the way, It made me realize that I wasn’t even aware of HTTP 2.0 as well.
So I propose to do a recap of the 3 versions of HTTP to understand what problem is being addressed, and what solution provides HTTP
Prerequisite
The Hypertext Transfer Protocol (HTTP) is an application layer protocol in the internet protocol suite model for distributed, collaborative, hypermedia information systems.
Internet protocol commonly known as TCP/IP is a framework for organizing the set of communication protocols used on the internet.
Hypermedia, an extension of the term hypertext, is a nonlinear medium of information that includes graphics, audio, video, plain text and hyperlinks.
Hypertext is the text displayed on a computer display or other electronic devices with references (hyperlinks) to other text that the reader can immediately access.
A hyperlink or simply a link is a digital reference to data that the user can follow or be guided by clicking or tapping. Hyperlinks point to a whole document or a specific element within a document.
What’s HTTP?
HTTP protocol was developed by Tim Berners-Lee at CERN in 1989 with a document describing the behavior of a client and a server using the first HTTP protocol version 0.9. The development of HTTP was continued by the Internet Engineering Task Force (IETF) and the World Wide Web Consortium (W3C).
HTTP functions as a request-response protocol in the client-server model. A web browser may be the client and a named web server running on a computer hosting the website may be the server. The client submits an HTTP request message to the server. The server, which provides resources such as HTML files and other content or performs other functions on behalf of the client, returns a response message to the client. The response contains completion status information about the request and may also contain requested content in its message body.
Its definition presumes an underlying and reliable transport layer protocol, thus Transmission Control Protocol (TCP) is commonly used.
HTTP/1
HTTP/1 was finalized in 1996 with the 1.0 version. In HTTP/1.0 a separate connection to the same server is made for every resource request.
In 1997, HTTP/1.1 used a TCP connection that can be reused to make multiple resource requests (HTML pages, frames, images, scripts, stylesheets, etc) and less latency.
Other updates follow in 1999, 2014 and 2022.
Its secure variant named HTTPS is used by more than 80% of websites.
HTTP/2
HTTP/2 is a revision of previous HTTP/1.1 published in 2015, that provides a more efficient expression of HTTP's semantics "on the wire".
to use a compressed binary representation of metadata (HTTP headers) instead of a textual one, so that headers require much less space
to use a single TCP/IP (usually encrypted connection per accessed server domain instead of 2 to 8 TCP/IP connections.
to use one or more bidirectional streams per TCP/IP connection in which HTTP requests and responses are broken down and transmitted in small packets to almost solve the problem of the HOLB (head of line blocking).
to add a push capability to allow server applications to send data to clients whenever new data is available (without forcing clients to request periodically new data to the server by using polling methods).
HTTP/2 communications, therefore, experience much less latency and, in most cases, even more speed than HTTP/1.1 communications.
It is now used by 41% of websites and supported by almost all web browsers (over 97% of users). It is also supported by major web servers over Transport Layer Security (TLS).
HTTP/3
HTTP/3 is a revision of the previous HTTP/2 that was published in 2022. It uses QUIC + UDP transport protocols instead of TCP/IP connections also to slightly improve the average speed of communications and to avoid the occasional (very rare) problem of TCP/IP connection congestion that can temporarily block or slow down the data flow of all its streams (another form of "head of the line blocking").
It is now used by over 25% of websites and is supported by many web browsers (over 75% of users). HTTP/3 uses QUIC instead of TCP for the underlying transport protocol. Like HTTP/2, it does not obsolesce previous major versions of the protocol. HTTP/3 has lower latency for real-world web pages, if enabled on the server, loads faster than HTTP/2, and even faster than HTTP/1.1.
Conclusion
HTTP has been developed since 1996 to allow users to interact with websites to get resources (in a client-server model). With the usage of the internet growing up fast, HTTP faced some HOLB issues. By evolving the protocol functions, HTTP can use different transport protocols to improve communications speed and have low-latency web pages.