HTTP/2 and HTTP/3: what changed and why it matters
By Flavio
Updated
Tagged: Networking
Learn how HTTP/2 and HTTP/3 changed connections, multiplexing, compression, QUIC, deployment, and the web performance decisions you make today.
HTTP still works the way you’d expect from the outside. A browser sends a request, and a server sends back a response. You still work with methods like GET and POST, status codes like 200 and 404, headers, URLs, and response bodies.
Under the hood, though, the way those messages travel across the network has changed a lot.
HTTP/1.1 sends messages as plain text over TCP. HTTP/2 turns them into binary frames and runs many exchanges in parallel over one TCP connection. HTTP/3 carries the same HTTP semantics over QUIC, a transport built on top of UDP.
That’s the short summary, though it doesn’t show why those changes matter when a real page loads. We’ll start with the problem HTTP/1.1 ran into, follow one page load through all three versions, and wrap up with the choices you should make on a modern site.
Here’s a quick look at how the three versions compare:
What is the difference between HTTP/2 and HTTP/3?
The main difference between HTTP/2 and HTTP/3 is the transport underneath. HTTP/2 multiplexes many requests over one TCP connection, so a single lost packet can stall every stream sharing it. HTTP/3 runs the same HTTP over QUIC on top of UDP, where a lost packet normally stalls only the stream it belongs to, and QUIC also sets up connections faster.
Another way to look at it is that HTTP/2 fixed the request queue inside HTTP, while HTTP/3 fixed the queue still left in the transport layer.
Here’s how the three versions line up side by side:
| Version | Message transport | Parallel requests | Header compression | Packet loss |
|---|---|---|---|---|
| HTTP/1.1 | text over TCP | no native multiplexing | no | affects its TCP connection |
| HTTP/2 | binary frames over TCP | multiplexed streams | HPACK | can stall every stream on the connection |
| HTTP/3 | frames over QUIC/UDP | multiplexed QUIC streams | QPACK | normally stalls only the affected stream |
All three versions live on the web at the same time. HTTP/3 didn’t turn off HTTP/2, and HTTP/2 didn’t make HTTP/1.1 go away. Browsers and servers negotiate a version they both support, and if HTTP/3 can’t connect, the browser falls back to HTTP/2 or HTTP/1.1 on its own.
What stayed the same
It helps to keep two layers of HTTP separate in your head:
- Semantics define what a request or response means.
- Mapping and transport define how that message crosses the network.
The current semantics live in RFC 9110. HTTP/2 is defined in RFC 9113, and HTTP/3 is defined in RFC 9114.
Because the semantics stayed the same, switching protocol versions doesn’t change application code like this:
const response = await fetch('/api/profile')
if (response.ok) {
const profile = await response.json()
}
The request still has a method and headers, and the response still has a status and a body.
HTTP caching keeps working too. Cache-Control, ETag, conditional requests, and 304 Not Modified responses behave the same over HTTP/3, even though the bytes on the wire look completely different.
The HTTP/1.1 problem
HTTP/1.1 has no multiplexing layer.
It can reuse a TCP connection for several requests, which is much better than opening a brand-new connection for every file. Even so, requests sharing that connection can’t make independent progress the way HTTP/2 streams do.
HTTP/1.1 pipelining tried to let browsers send several requests without waiting for each reply first. The problem was that responses still had to come back in request order, and too many proxies and intermediaries in the wild handled it poorly, so it never worked as a general solution.
Browsers worked around the limit by opening several TCP connections to the same origin. Six connections per origin became the common cap, though the exact number is an implementation detail.
Say a page needs HTML, CSS, JavaScript, two fonts, and twenty images. The browser has way more files to fetch than connection slots to put them in, so requests start queuing up like this:
Waiting for a free connection slot is application-level head-of-line blocking, and opening extra connections has real costs of its own. Each TCP connection has to go through setup and run its own congestion control, and because every connection probes the network capacity independently, a bunch of competing connections often use the path less efficiently than a single well-managed one.
The workarounds we built
For years, developers reshaped sites just to work around those connection limits.
We combined icons into sprite sheets, concatenated CSS and JavaScript into giant bundles, and turned images into inline data URLs. We also split files across domains like static1.flaviocopes.com and static2.flaviocopes.com to squeeze more connections out of the browser.
Those tricks cut down on waiting under HTTP/1.1, though they came with ugly trade-offs. Changing one line could invalidate an entire bundle, and a sprite sheet forced browsers to download icons the page never used. Domain sharding added extra DNS lookups, TCP connections, and TLS handshakes, and inlining meant the browser couldn’t cache those resources on their own.
HTTP/2 was designed to fix the connection-slot problem directly so we could stop piling on workarounds.
How HTTP/2 starts
HTTP/2 was first standardized in 2015 as RFC 7540, and the current spec is RFC 9113 from 2022.
On a public HTTPS site, the browser and server normally agree on HTTP/2 during the TLS handshake using ALPN (Application-Layer Protocol Negotiation), where HTTP/2 uses the identifier h2.
Conceptually, the client offers a list of protocols it supports:
h2
http/1.1
The server picks one it supports, and they use it from there.
This happens before the browser sends the first HTTP request. The URL doesn’t turn into http2://..., and your application routes don’t change.
HTTP/2 can run without TLS in a mode called h2c, though browsers stick to TLS for public websites, making HTTPS the baseline in practice.
Because HTTP/2 keeps HTTP semantics while changing the wire format, an HTTP/1.1 client can’t read HTTP/2 frames. Negotiation and fallback bridge that gap so the upgrade stays transparent to most apps.
Binary framing
In HTTP/1.1, a request travels over the wire as plain text lines like these:
GET /avatar.jpg HTTP/1.1
Host: flaviocopes.com
Accept: image/avif,image/webp,*/*
HTTP/2 doesn’t send that text block. Instead, it splits messages into binary frames. A HEADERS frame carries the compressed header fields, one or more DATA frames carry the body, and other frames handle settings, flow control, cancellation, and connection management.
Every frame includes a stream identifier so the receiver knows right away which request or response it belongs to. Using a binary format saves some bytes, sure, though the bigger win is giving both sides an unambiguous structure they can parse fast and interleave cleanly.
Streams and multiplexing
An HTTP/2 connection holds many streams, with each request and response exchange running on its own stream.
Frames from different streams can travel interleaved over the same TCP connection:
The server might send part of a CSS file, then part of an image, and then the rest of the CSS, while the browser puts each message back together from its stream’s frames.
That means a slow response no longer forces every response behind it to sit and wait while other streams keep moving. You also get better connection reuse, since one warm TLS connection can carry dozens of requests without the browser spinning up a fleet of TCP connections.
HPACK header compression
HTTP headers repeat a lot of the same data.
Every request to the same origin tends to carry the same user agent, accepted encodings, cookies, and standard fields. Sending all that text again and again wastes bytes, especially when the response itself is small.
HTTP/2 uses HPACK, defined in RFC 7541. It combines a static table of common fields with a dynamic table shared by the encoder and decoder, so later requests can point to table entries instead of repeating every value.
HPACK only compresses HTTP header fields, though. You still want Brotli or gzip enabled for response bodies like CSS, JavaScript, HTML, and JSON.
Flow control
Multiplexing raises a practical question: how much data can each side send at once?
HTTP/2 handles this with flow-control windows for individual streams and for the whole connection. As the receiver reads data, it sends WINDOW_UPDATE frames to advertise more capacity, which keeps a fast sender from overwhelming the receiver or letting one huge download eat up unlimited buffers.
Flow control works hop by hop. A CDN can have one HTTP/2 connection to the browser and a separate connection to your origin, with each hop managing its own windows.
Prioritization is more complicated than the original story
The first HTTP/2 spec included a detailed priority tree that let clients describe dependencies and weights between streams.
In practice, it proved hard to implement consistently, and many servers and proxies ignored the signals anyway. RFC 9113 deprecated that original priority scheme.
The newer Extensible Prioritization Scheme replaces it with simpler urgency and incremental hints, though support still varies across browsers, servers, and intermediaries.
No matter how well the server prioritizes streams, resource discovery still matters. Put critical CSS where the browser finds it early, keep the main image out of late JavaScript, and reach for preload and fetchpriority only when measurements show they help.
What happened to HTTP/2 server push
HTTP/2 also introduced server push, letting a server send a file before the browser even asked for it.
On paper, it sounded great: the server already knows the page needs app.css, so why wait for a request? The hard part was knowing what the browser already had in its cache and what it really needed. Pushing a file unnecessarily wastes bandwidth and can compete with the HTML itself.
Chrome removed HTTP/2 server push support in version 106 after real-world deployments showed little use and no clear performance gain. Chrome’s explanation points to preload and 103 Early Hints as more practical options. Skip server push if you’re putting together an optimization plan today.
The problem HTTP/2 could not fix
HTTP/2 multiplexes streams inside one connection, and that connection still runs on TCP.
TCP gives the application a single reliable, ordered byte stream. If packet 20 goes missing while packet 21 arrives, TCP can’t hand the later bytes up to HTTP/2 yet, because it has to wait for packet 20 to be retransmitted.
Even if that missing packet belonged to one image, TCP knows nothing about HTTP/2 streams. Every stream shares the same ordered TCP byte stream, so unrelated work pauses too.
This is transport-level head-of-line blocking. On a fast, clean network, recovery can happen fast enough that you barely notice. On mobile connections, congested Wi-Fi, or long-distance links, those pauses show up much more clearly, and HTTP/3 changes the transport to fix it.
HTTP/3 runs over QUIC
HTTP/3 was standardized in 2022 and maps HTTP semantics onto QUIC, defined in RFC 9000.
QUIC runs over UDP, though calling it “unreliable HTTP over UDP” misses how it works. QUIC implements reliability, congestion control, flow control, streams, and connection management itself, using UDP underneath so those features can evolve without waiting for operating-system TCP stacks to change.
QUIC version 1 integrates TLS 1.3 directly into its handshake, so HTTP/3 is encrypted by default and has no public cleartext mode equivalent to plain HTTP over TCP.
Here’s a conceptual look at how the two protocol stacks compare:
With HTTPS over TCP, TLS sits as a layer on top of TCP, whereas QUIC builds the TLS handshake right into the transport protocol.
Independent QUIC streams
QUIC lets a single connection carry multiple reliable streams side by side. Bytes arrive in order inside each stream, while separate streams don’t have to wait on one another.
Say a packet for an image drops in transit. That image stream pauses to recover the missing packet, while a CSS stream whose packets made it through keeps moving. That’s how HTTP/3 eliminates the connection-wide head-of-line blocking HTTP/2 inherits from TCP.
You’ll still feel packet loss, of course. Congestion slows down the whole path, and a dropped packet still stalls the stream it belongs to.
QPACK replaces HPACK
HTTP/3 compresses headers too, just not with HPACK. HPACK relies on header blocks arriving in strict order across the entire connection, and QUIC intentionally removes that cross-stream ordering.
To solve that, HTTP/3 uses QPACK, defined in RFC 9204. QPACK separates updates to the dynamic table from the individual request streams that point to it. You’ll never configure QPACK in your application code, since your server or CDN handles it for you, so the main thing to know is why HTTP/3 couldn’t just reuse HTTP/2’s header compression.
Faster connection setup
A fresh HTTPS connection over TCP has to complete a TCP handshake and then a TLS handshake before any application data moves. QUIC merges transport and cryptographic setup together, so a new connection usually starts flowing after a single round trip.
When a client returns to a server it has talked to recently, it can even send 0-RTT early data right away without waiting for a round trip. There’s a catch, though: an attacker on the network can replay early data, so servers only accept it for operations that are safe to repeat. Serving a GET request for a public page is fine, whereas processing a POST that charges a credit card isn’t.
Your CDN or server enforces that policy automatically, so expect some repeat visits to skip setup and others to take the normal path.
Connection migration
A TCP connection is identified by its source and destination IP addresses and ports. Walk out the door and let your phone switch from Wi-Fi to cellular, and that identity changes because your IP address changed.
QUIC identifies connections with a connection ID instead of tying them to one network path. When your device switches networks, the server validates the new path and the connection keeps going. On mobile, an active download or API session can often survive the switch instead of restarting from scratch.
A dead zone, a timeout, or a network that blocks UDP will still drop the connection, so your app still needs normal retry and reconnect handling.
How a browser discovers HTTP/3
Most first visits start over TCP. The server then lets the browser know HTTP/3 is ready by sending an Alt-Svc response header:
Alt-Svc: h3=":443"; ma=86400
That header tells the browser it can reach the same service over HTTP/3 on UDP port 443, and ma=86400 tells it to remember that advertisement for 86,400 seconds. On a follow-up request or new connection, the browser can try QUIC. Modern clients can also discover HTTP/3 ahead of time through DNS HTTPS records.
If a corporate network, hotel Wi-Fi, or older router blocks UDP, or if the QUIC attempt fails, RFC 9114 instructs the client to fall back to TCP-based HTTP. Here’s how that discovery and fallback sequence plays out:
HTTP/3 is not automatically faster
HTTP/3 shines on networks with packet loss or changing paths, yet you won’t see lower numbers on every single request.
On a stable connection close to the server, HTTP/2 often performs just as well. QUIC encryption and packet processing can use more CPU, a weak implementation can wipe out the protocol gains, and the first HTTP/3 attempt often races against a working TCP connection.
Always measure the full user experience. Switching transport protocols won’t fix a slow database query, an overloaded server, an uncacheable response, a 2 MB JavaScript bundle, or an image that’s ten times larger than it needs to be.
What changes for frontend work
A lot of old HTTP/1.1 advice is obsolete now, while a few other rules swung too far in the opposite direction after HTTP/2 arrived.
Stop domain sharding
Spreading assets across multiple hostnames breaks connection reuse. Each extra hostname can trigger its own DNS lookup, connection setup, TLS negotiation, and congestion state.
Keep your first-party assets on as few origins as practical. Using a separate image CDN still makes sense when you’re getting resizing, caching, and global delivery. Just stop spinning up extra domains purely to unlock more HTTP/1.1 connection slots.
Do not bundle only to reduce request count
Because HTTP/2 and HTTP/3 handle concurrent requests well, you don’t need to concatenate every file into one giant bundle anymore.
Still, don’t swing to the other extreme and ship one file per function. Every request carries headers, scheduling work, cache lookups, parsing, and execution overhead. Split your code around routes and features so visitors only download what they need, keep stable dependencies cacheable across deployments, and measure the result.
Do not use sprites only to save connections
Separate SVG and image files can be cached and updated on their own. Modern image formats and image CDNs usually make a bigger difference than shaving off one request.
Sprites still fit certain graphics workflows. Just don’t use them solely to work around the old six-connection limit.
Keep optimizing discovery
Multiplexing only kicks in once the browser knows a URL exists. If JavaScript has to download, run, and only then reveal the main image, neither HTTP/2 nor HTTP/3 can request that image any earlier.
Good HTML structure, the browser’s preload scanner, preload, modulepreload, and fetchpriority still control how early requests start.
Keep caching
Skipping a network request altogether always beats even the fastest transport. Give hashed static assets long cache lifetimes, keep HTML on a shorter policy, and set deliberate rules for APIs and private pages. If you want to reason about browser and shared-CDN caching separately, try the Cache-Control builder.
What changes for backend and API work
Most application handlers shouldn’t care which HTTP version carried the request. Your framework receives an HTTP request and returns an HTTP response, and a reverse proxy or CDN usually terminates HTTP/2 or HTTP/3 before traffic reaches your process.
Still, keep a few protocol differences in mind:
- Leave out connection-specific headers like
Connectionin HTTP/2 and HTTP/3 messages. - Skip HTTP/1.1 chunked transfer encoding, since HTTP/2 and HTTP/3 framing already marks message boundaries.
- Don’t depend on
statusTextcontaining text, because HTTP/2 and HTTP/3 don’t send reason phrases. - Streaming still works, though proxies and buffering policies can change when bytes reach the client.
- A single client can open many concurrent streams at once, so keep request limits and backpressure in place on the server.
Don’t branch business logic on h2 versus h3. Treat the negotiated protocol as an operational and performance detail unless you’re building network infrastructure.
How I use HTTP/2 and HTTP/3
This site is a static Astro 7 build on Cloudflare Pages. Astro writes plain HTML, CSS, and JavaScript files at build time, and Cloudflare serves them.
Cloudflare terminates the browser connection at its edge, so I don’t run a QUIC server inside Astro. Visitors can get pages over HTTP/3 while Cloudflare takes care of deployment, certificates, negotiation, and fallback.
You can see that setup in the live response headers:
HTTP/2 200
server: cloudflare
alt-svc: h3=":443"; ma=86400
My command-line curl negotiated HTTP/2, and the Alt-Svc header right below it advertises HTTP/3 to clients that support QUIC.
My Cloudflare Pages Functions work the same way. Both the /purchase webhook and the course-access endpoint read ordinary requests and return ordinary responses, without separate code paths for HTTP/2 and HTTP/3.
I let the infrastructure handle the protocols and focus my application work on what I control:
- generating static HTML where possible
- keeping first-party assets on reusable origins
- serving downloads through Cloudflare R2
- setting the right cache rules
- trimming image and JavaScript bytes
- keeping server work fast
- checking the protocol from the browser and command line
In a Hono or Astro app with several parallel API requests, multiplexing stops those calls from fighting over a small HTTP/1.1 connection pool. I still cut unnecessary requests wherever I can, since a faster transport won’t make a chatty API free.
For large downloads, HTTP/3 can recover better when one stream loses packets or the user switches networks. File size, edge location, cache status, and server throughput often matter more, so I look at all of them together.
When I would not manage HTTP/3 myself
If your site already sits behind Cloudflare, Fastly, Akamai, or another capable CDN, let the edge handle HTTP/3 for you.
Running QUIC yourself means operating UDP listeners, certificates, updates, observability, resource limits, and fallbacks. That makes sense for a CDN, proxy, browser, or specialized high-traffic service. For a normal content site or CRUD app, your time goes much further elsewhere.
Also don’t treat HTTP/3 as a substitute for WebSockets, Server-Sent Events, or WebTransport. HTTP/3 improves HTTP request and response delivery, so reach for those protocols when your app needs bidirectional realtime messaging.
How to inspect the negotiated protocol
The quickest place to check is browser DevTools. Open the Network panel, turn on the Protocol column, and reload the page. Depending on your browser, you’ll see values like:
http/1.1h2h3
Check both the HTML document and a few first-party resources. Don’t be surprised if the first navigation uses HTTP/2 and later requests switch to HTTP/3, because discovery, cached Alt-Svc entries, connection racing, and warm connections all affect what gets picked.
Inspect HTTP/2 with curl
First, check how your curl build was compiled:
curl --version
Look for HTTP2 on the Features line. Next, fetch only the response headers:
curl --http2 -I https://flaviocopes.com/
The first line shows the HTTP version curl selected:
HTTP/2 200
If you only want the version without printing all the headers, run:
curl -sS -o /dev/null \
-w 'HTTP version: %{http_version}\n' \
https://flaviocopes.com/
Inspect HTTP/3 with curl
Your curl build needs HTTP/3 support compiled in, and many default system builds include HTTP/2 without HTTP/3.
If curl --version lists HTTP/3, try requesting the URL with HTTP/3 enabled:
curl --http3 https://flaviocopes.com/ -o /dev/null
When you want the test to fail instead of quietly falling back to HTTP/2, use --http3-only:
curl --http3-only -I https://flaviocopes.com/
That strict flag saves a lot of guesswork while debugging, because a normal HTTP/3 test can still succeed over HTTP/2 if QUIC fails.
Read the headers carefully
This command shows the server’s HTTP/3 advertisement even when the request itself uses HTTP/2:
curl -I https://flaviocopes.com/
Look for this header in the output:
Alt-Svc: h3=":443"; ma=86400
Keep in mind that Alt-Svc only advertises HTTP/3 availability. To verify the response you just received traveled over HTTP/3, check the negotiated protocol line in curl or the Protocol column in DevTools.
Common reasons HTTP/3 does not appear
If your browser stays on HTTP/2 when you expected HTTP/3, check these six things:
- The CDN or server has HTTP/3 turned on.
- UDP port 443 can reach the edge.
- The TLS certificate and HTTPS configuration are valid.
- The response advertises HTTP/3 or DNS HTTPS discovery is configured.
- The browser hasn’t cached an old alternative-service entry.
- A VPN, firewall, proxy, or antivirus tool isn’t blocking QUIC.
When UDP is blocked or unreachable, browsers fall back to HTTP/2 and your site keeps working normally over TCP.
How to measure whether it helped
Seeing h3 show up in DevTools is a good sanity check, though it won’t tell you whether your pages feel faster. To see if the upgrade made a real difference, test across conditions where transport changes show up:
- cold first visits and warm repeat visits
- low-latency links and high-latency connections
- clean networks and lossy ones where packets get dropped
- desktop browsers and real mobile networks
- cached and uncached resources
- a single large response compared to a page pulling in many parallel files
In the waterfall, look at request start times, stalled time, time to first byte, and total completion time. Then tie those numbers to user-facing metrics like LCP and INP.
Run multiple samples for each case, since connection reuse and normal network jitter can easily throw off a single trace.
Common mistakes
“HTTP/2 makes every request parallel”
Multiplexing lets requests share one connection, which helps a lot, but it isn’t unlimited parallelism. The browser, the server, flow-control windows, stream prioritization, and your own application limits still control what gets sent first and how fast it moves.
“HTTP/3 has no head-of-line blocking”
HTTP/3 removes head-of-line blocking between independent QUIC streams, so a lost packet in one stream won’t stall the others. Inside a single stream, bytes still have to arrive in order, and network congestion can still affect the whole connection.
“UDP means packets can disappear”
Raw UDP doesn’t guarantee delivery on its own, which is why this myth sticks around. With HTTP/3, QUIC sits on top of UDP and handles reliable streams, packet recovery, congestion control, and security.
“HTTP/3 removes the need for a CDN”
HTTP/3 improves the transport layer, not the physical distance between your server and your visitors. A CDN still shortens that distance, caches content, absorbs traffic spikes, and terminates connections close to users.
“More files are always better now”
Making extra requests is much cheaper than it was under HTTP/1.1, so you don’t have to mash everything into one giant bundle anymore. Each request still has a cost, though, so split files around useful caching and loading boundaries.
“The backend must be rewritten for QUIC”
In most setups, your CDN or reverse proxy handles QUIC and HTTP/3 at the edge. Your application keeps returning normal HTTP responses just like before.
A migration checklist
If you’re modernizing an older site, run through these steps:
- Serve the entire site over HTTPS.
- Enable HTTP/2 at your CDN, reverse proxy, or server.
- Enable HTTP/3 wherever your edge supports it.
- Keep HTTP/2 and HTTP/1.1 fallback available so older clients and restricted networks keep working.
- Remove domain sharding if you only added it to get more browser connection slots.
- Revisit giant bundles and sprite sheets built for HTTP/1.1.
- Keep sensible bundling, compression, and cache boundaries.
- Make important resources easy for the browser to discover early.
- Verify
h2andh3in DevTools. - Test on slower, constrained networks, not just local broadband.
The model to remember
HTTP/1.1 has no native request multiplexing, so browsers opened several TCP connections at once to get parallelism.
HTTP/2 brings binary frames and independent HTTP streams over a single TCP connection, with HPACK compressing repeated headers. The tradeoff is that TCP packet loss can still pause every stream sharing that connection. HTTP/3 moves HTTP onto QUIC instead, giving you encrypted, independent transport streams over UDP, faster setup opportunities, connection migration, and QPACK header compression built for independently delivered streams.
For most web developers, this upgrade belongs at your CDN or server edge rather than inside your app code. Use HTTPS, remove old HTTP/1.1 workarounds, keep caching and resource discovery in good shape, and verify the results under real network conditions.
Want me to talk about your product? You can sponsor this site.
Related posts about network: