Understanding HTTP/1.1, HTTP/2, and HTTP/3
HTTP is one of the most useful protocols to understand when learning backend engineering, networking, or system design. HTTP/1.1, HTTP/2, and HTTP/3 all let clients and servers exchange requests and responses. What changed between them is how those messages are encoded and carried across a network.
To understand why there are three versions, we will start with an HTTP request, then look at the transport protocols beneath it: TCP, UDP, and QUIC.
What HTTP does
HTTP stands for Hypertext Transfer Protocol. It defines how a client, such as a browser, asks a server for something and how the server replies.
For example, when a browser loads an analytics dashboard, it might request a list of projects:
GET /api/projects HTTP/1.1
Host: traceiq.run
Accept: application/json
The server might respond with a status code, headers describing the response, and a body containing the data:
HTTP/1.1 200 OK
Content-Type: application/json
{
"projects": [
{ "id": 1, "name": "NuWell" },
{ "id": 2, "name": "TraceIQ" }
]
}
GET is the request method, /api/projects is the path, and 200 OK is the response status. The JSON after the blank line is the response body.
A modern page usually needs many resources: HTML, stylesheets, scripts, images, fonts, and API data. The browser may make dozens or hundreds of requests, so the way those requests share network connections matters.
A quick networking primer
Protocols are often described in layers. Each layer has a specific job and passes data to the layer below it.
For a typical website request:
- HTTP defines the request and response.
- TCP or QUIC transports the data between the client and server.
- IP routes packets between networks.
The details of this stack help explain why HTTP/2 and HTTP/3 behave differently when network data is lost.
TCP: reliable, ordered delivery
TCP stands for Transmission Control Protocol. It provides applications with a reliable, ordered stream of bytes between two endpoints.
TCP divides that stream into smaller pieces for transmission. The receiving computer acknowledges data it has received. If data is missing, TCP can retransmit it. It also reassembles data in order before passing the byte stream to the application.
Imagine sending numbered pages from a book. If page 3 is delayed but pages 4 and 5 arrive, the receiver cannot hand the application a complete ordered stream past page 2 until page 3 arrives. TCP's ordering guarantee is valuable, but it means a missing piece can temporarily hold up later bytes on the same connection.
TCP also has flow control, which helps prevent a sender from overwhelming a receiver, and congestion control, which adjusts how much data is sent based on conditions in the network.
UDP: datagrams without built-in delivery guarantees
UDP stands for User Datagram Protocol. It sends independent units of data called datagrams. UDP itself does not guarantee that a datagram will arrive, arrive only once, or arrive in the order it was sent. It does not retransmit lost datagrams.
That does not make UDP inherently faster than TCP. It means UDP provides fewer built-in transport features. Applications that use UDP can choose which additional behavior they need.
TLS: encryption for network traffic
TLS, or Transport Layer Security, encrypts traffic and helps a client verify the identity of the server it is communicating with. HTTPS is HTTP protected by TLS.
HTTP/1.1 and HTTP/2 commonly use TLS over TCP. HTTP/3 uses QUIC, which incorporates TLS 1.3 into its connection setup.
HTTP/1.1: persistent connections, limited concurrency
HTTP/1.1 was standardized in 1997. One important improvement was persistent connections: a client could reuse a TCP connection for multiple requests instead of opening a new connection for each one.
However, HTTP/1.1 did not provide the same kind of request multiplexing that HTTP/2 later added. On a single connection, responses had to be handled in order. If an earlier response took a long time, later responses could be held up behind it. This is one form of head-of-line blocking: work at the front of a queue prevents work behind it from moving forward.
HTTP/1.1 also defined pipelining, which allowed a client to send multiple requests before receiving their responses. Because responses still had to arrive in order and browser support was limited, browsers generally relied on opening several connections to the same server to fetch resources concurrently.
That approach works, but each additional connection has setup and resource costs. HTTP/2 was designed to make better use of a connection.
HTTP/2: multiplexing over one TCP connection
HTTP/2 was standardized in 2015. It introduced multiplexing: multiple independent HTTP request and response streams can share one connection.
Instead of waiting for one response to finish before sending data for another, HTTP/2 divides messages into smaller frames. Frames from different streams can be interleaved on the connection. Each frame carries a stream identifier so the receiver can tell which request it belongs to.
One HTTP/2 connection
Stream 1: HTML frames
Stream 3: CSS frames
Stream 5: JavaScript frames
Stream 7: image frames
HTTP/2 also compresses repeated headers using HPACK. Headers are metadata such as the request path, content type, accepted formats, and authorization information. Compressing repeated values reduces the amount of data sent.
Multiplexing removes the need to serialize complete HTTP responses on one connection. But HTTP/2 still runs over TCP, and TCP delivers one ordered byte stream. That creates a different kind of head-of-line blocking.
The hidden HTTP/2 limitation: TCP head-of-line blocking
Suppose an HTTP/2 connection is carrying frames for HTML, CSS, and JavaScript. A piece of TCP data containing part of the HTML stream is lost.
TCP sees one ordered byte stream, not separate HTTP/2 streams. It must wait for the missing TCP data before passing later bytes to HTTP/2. As a result, frames for CSS or JavaScript that arrived after the missing data may also be delayed, even if those frames were not lost.
This is called TCP-level head-of-line blocking. HTTP/2 allows HTTP streams to make progress independently, but its shared TCP connection can still delay all streams when TCP data is missing.
The distinction is important:
- HTTP/1.1 head-of-line blocking: responses on a connection are constrained by HTTP/1.1's request and response ordering.
- HTTP/2 over TCP head-of-line blocking: a missing piece of the TCP byte stream can delay later bytes for every HTTP/2 stream on that connection.
HTTP/3 changes the transport layer to address the second problem.
HTTP/3: HTTP over QUIC
HTTP/3 was standardized in 2022. It uses QUIC, a transport protocol built on top of UDP.
QUIC provides many features associated with TCP, including reliable delivery, retransmission, congestion control, and flow control. Unlike TCP, QUIC organizes data into independent streams. It also integrates TLS 1.3 into its connection setup.
HTTP/3 maps HTTP requests and responses onto QUIC streams. If data for one stream is lost, QUIC can continue delivering available data for other streams without waiting for the missing data from the first stream.
One QUIC connection
Stream A: HTML — waiting for lost data
Stream B: CSS — can continue
Stream C: JavaScript — can continue
This avoids TCP's connection-wide ordering delay between independent streams. It does not mean loss has no cost: QUIC connections still share network capacity and congestion control, so packet loss can reduce the rate at which the connection sends data.
Connection setup and encryption
With HTTPS over TCP, a new connection typically requires establishing TCP and then negotiating TLS before application data can be exchanged. QUIC combines transport setup with a TLS 1.3 handshake, which can reduce the number of round trips needed to begin a secure connection.
A round trip is the time for a message to travel to the other endpoint and for a response to return. Reducing round trips can help when latency is high, such as when a server is geographically far from the user.
For some resumed connections, QUIC supports 0-RTT data, which can allow a client to send application data before the handshake fully completes. Early data can be replayed in some circumstances, so applications and servers must take care not to use it for operations where replay would cause harm.
Connection migration
QUIC connections use connection identifiers in addition to network addresses. This can allow a connection to survive a change in the client's IP address, such as when a phone switches from Wi-Fi to cellular data. QUIC validates the new network path before continuing to use it.
This feature is called connection migration. It can be useful on mobile networks, where network changes are common.
Comparing the three versions
| Feature | HTTP/1.1 | HTTP/2 | HTTP/3 | | --- | --- | --- | --- | | Standardized | 1997 | 2015 | 2022 | | Transport | TCP | TCP | QUIC over UDP | | Multiple streams on one connection | No HTTP-level multiplexing | Yes | Yes | | Header compression | No built-in header compression | HPACK | QPACK | | Can TCP loss block other streams? | TCP ordering applies | Yes | No TCP connection; QUIC isolates stream delivery | | Encryption | Commonly used with TLS as HTTPS | Commonly used with TLS as HTTPS | TLS 1.3 is integrated into QUIC | | Connection migration | Not built into HTTP/1.1 | Not built into HTTP/2 | Supported by QUIC |
HTTP/3 uses QPACK rather than HPACK for header compression. QPACK is designed for HTTP/3's multiplexed transport so that header compression does not recreate unnecessary blocking between streams.
These protocol versions preserve the core semantics of HTTP. A request such as GET /api/users still means the same thing. The versions differ mainly in how HTTP messages are framed and transported.
A dashboard example
Imagine a dashboard making these requests:
GET /api/events
GET /api/funnels
GET /api/users
GET /api/sessions
GET /api/errors
GET /api/revenue
Suppose the server responds in these times:
| Request | Response time | | --- | ---: | | Events | 100 ms | | Funnels | 800 ms | | Users | 150 ms | | Sessions | 200 ms | | Errors | 120 ms | | Revenue | 300 ms |
If the browser had to make all six requests sequentially on one connection, the response times alone would add up to 1,670 ms. Browsers can use multiple HTTP/1.1 connections and issue requests concurrently, so this is not a prediction of the actual page-load time.
With HTTP/2 or HTTP/3, multiple requests can share a connection and make progress concurrently. If the server handles them independently and the network has enough capacity, the dashboard may receive most responses before the slowest request finishes.
If the Funnels response is slow because of a database query, changing the HTTP version will not make that query faster. HTTP/2 and HTTP/3 improve how data moves over the network; they do not automatically improve application code, database performance, or server capacity.
The difference between HTTP/2 and HTTP/3 becomes more noticeable when data is lost. On HTTP/2, TCP may hold later bytes for every stream until missing bytes are retransmitted. On HTTP/3, other QUIC streams can continue delivering data while the affected stream waits for its missing data.
How a browser chooses a version
Application code usually does not choose the HTTP version. For example, this JavaScript request does not specify HTTP/1.1, HTTP/2, or HTTP/3:
const response = await fetch("https://traceiq.run/api/events");
const events = await response.json();
The browser and server negotiate a mutually supported protocol. For HTTP/1.1 and HTTP/2 over TLS, they commonly use ALPN (Application-Layer Protocol Negotiation) during the TLS handshake. ALPN lets the endpoints agree on a protocol such as http/1.1 or h2.
HTTP/3 support can be advertised with an Alt-Svc response header or discovered through DNS HTTPS records. If HTTP/3 is unavailable or cannot be used, the browser can fall back to HTTP/2 or HTTP/1.1.
To see which version was used in Chrome:
- Open Developer Tools and select the Network tab.
- Right-click a column heading and enable Protocol.
- Reload the page and inspect the protocol column.
Common values include:
| Value | Protocol |
| --- | --- |
| http/1.1 | HTTP/1.1 |
| h2 | HTTP/2 |
| h3 | HTTP/3 |
You can also check a server with curl. First, check which protocol features your curl build supports:
curl -V
Then try an individual HTTP version:
curl -I --http1.1 https://traceiq.run
curl -I --http2 https://traceiq.run
curl -I --http3 https://traceiq.run
-I asks for response headers without downloading the response body. The HTTP/2 and HTTP/3 options only work if that curl build includes support for those protocols and the server makes them available.
HTTP/3 is not simply "UDP is faster"
It is common to hear that HTTP/3 is faster because it uses UDP instead of TCP. That description misses the important part.
UDP by itself does not provide the reliability, ordering, congestion control, or stream behavior required by HTTP. QUIC builds the needed transport features on top of UDP and gives streams independent delivery behavior.
HTTP/1.1 -> TCP -> IP
HTTP/2 -> TCP -> IP
HTTP/3 -> QUIC -> UDP -> IP
HTTP/3 can reduce delays caused by TCP's connection-wide ordered delivery and can reduce connection-setup latency in some situations. It is not guaranteed to be faster in every network or workload. Server configuration, network conditions, latency, packet loss, and application performance all matter.
What to remember
- HTTP defines requests and responses. The HTTP version does not change the meaning of methods such as
GETorPOST. - TCP provides a reliable, ordered byte stream. That ordering can hold up later data when an earlier piece is missing.
- HTTP/2 multiplexes multiple streams over one TCP connection. It improves concurrency, but TCP loss can still delay all streams on that connection.
- QUIC carries independent streams over UDP. HTTP/3 uses QUIC to prevent a missing piece of one stream from automatically blocking delivery on other streams.
- A newer HTTP version is not a substitute for a healthy backend. It cannot fix slow queries, overloaded services, or inefficient application logic.
If three files are downloading over HTTP/2 and one loses a TCP segment, the other files may be delayed because TCP must deliver bytes in order on their shared connection. With HTTP/3, QUIC can keep delivering data from the other streams while it recovers the missing data for the affected stream. The streams still share connection capacity, but they do not share TCP's ordered byte-stream blocking.