HTTP/2 Multiplexing
You'll learn how HTTP/2 multiplexing eliminates the connection bottleneck by sending multiple requests and responses simultaneously over a single TCP connection.
The HTTP/1.1 Bottleneck You Already Know
In the previous lesson, you learned that HTTP/1.1 forces browsers to use multiple TCP connections (typically 6 per domain) to load resources in parallel, and that head-of-line blocking makes requests wait in line on each connection. This is inefficient and slow.
What HTTP/2 Multiplexing Changes
HTTP/2 multiplexing allows multiple requests and responses to be in flight at the same time over a single TCP connection. Instead of sending complete files one after another, HTTP/2 breaks them into smaller frames that can be interleaved.
Think of It Like a Highway
HTTP/1.1 is like a single-lane road where cars (requests) must wait for the car ahead to reach its destination before moving.
HTTP/2 multiplexing is like a multi-lane highway where all cars travel simultaneously, and you can even split a large truck's cargo across multiple lanes so smaller cars don't get stuck behind it.
How It Works
- Requests and responses are divided into frames
- Frames from different resources are interleaved (mixed together)
- Each frame is tagged with a stream ID so the browser knows which resource it belongs to
- The browser reassembles frames into complete responses
- No head-of-line blocking at the HTTP layer—all requests proceed in parallel
Real-World Impact
You no longer need hacks like domain sharding or sprite sheets for performance. One connection handles everything efficiently, reducing connection overhead and improving page load times.
Key Takeaway: HTTP/2 multiplexing eliminates HTTP/1.1's connection bottleneck by interleaving multiple request/response frames over a single TCP connection, allowing truly parallel resource loading.