Hyper Text Transfer Protocol
HTTP (Hypertext Transfer Protocol) is a protocol used for transferring data over the internet. It's the foundation of data communication for the World Wide Web. HTTP is a client-server protocol, where the client (usually a web browser) initiates a request, and the server responds with the requested data.
There are multiple versions of HTTP and each version brings improvements to the protocol. The most common versions are HTTP/1.1, HTTP/2, and HTTP/3.
If you are wondering, how do we know which version of HTTP is being used ? You can find this out by looking at the requests in the network tab of your browser's developer tools.
By default you might not have protocol column in the network tab. To enable it, right click on the network tab and select "Protocol".
Here's what you see in the protocol column:
The H3 in protocol column means HTTP/3. Go to google.com and you can see this for yourself.

This blog uses HTTP/2.

If you go to shippingchina.com, you will see HTTP/1.1.

How does browser decide which version of HTTP to use ?
- Browsers decide which HTTP version to use through a process called "HTTP version negotiation".
- When the browser makes the first request to the server, it starts by using the most recent version of HTTP it supports.
- If the server doesnt support the version, it downgrades to the next supported version, one by one.
Comparison of HTTP/1, HTTP/2, and HTTP/3
Here's a quick comparison of HTTP/1, HTTP/2, and HTTP/3:
Feature | HTTP/1.1 | HTTP/2 | HTTP/3 |
---|---|---|---|
Release Year | 1997 | 2015 | 2022 (Finalized) |
Transport Protocol | TCP | TCP | QUIC (Based on UDP) |
Connection Management | One connection per request (or keep-alive for multiple sequential requests) | Single multiplexed connection for multiple requests | Multiple independent streams over a single connection |
Multiplexing | No - Head-of-line blocking issues | Yes - Multiple requests in parallel over single connection | Yes - Independent streams with no head-of-line blocking |
Header Compression | No - Headers sent in plain text | Yes - HPACK compression | Yes - QPACK compression |
Server Push | No | Yes - Server can push resources before client requests | Yes - Enhanced with better control |
Latency | Higher latency due to TCP handshakes | Improved over HTTP/1.1 but still affected by TCP | Significantly reduced with 0-RTT connection establishment |
Connection Migration | No - New connection needed when network changes | No - New connection needed when network changes | Yes - Can survive IP changes (mobile to WiFi) |
Binary Protocol | No - Text-based | Yes - More efficient parsing | Yes - Binary framing |
Use Cases |
|
|
|
Limitations |
|
|
|
Browser Support | Universal | Most modern browsers (>95%) | Growing (Chrome, Firefox, Safari, Edge) |
Real World Examples |
|
|
|
When to Use |
|
|
|
Summary
If your distributed system demands low latency, efficient bandwidth utilization, handles many concurrent requests, or requires strong security, migrating to HTTP/2 or HTTP/3 offers substantial advantages over HTTP/1.1. The specific choice between HTTP/2 and HTTP/3 often depends on the maturity of library support and the specific network conditions you anticipate. HTTP/3's use of QUIC over UDP can be particularly beneficial in lossy network environments, but might face challenges with firewall configurations in some scenarios.