HTTP/2 Multiplexing

Problem

A browser needs many resources simultaneously. Using connections inefficiently or serializing requests creates unnecessary waiting.

Solution — HTTP/2 Streams

Multiple request/response streams share one TCP connection, with TLS for HTTPS. Keep-alive reuses a connection over time; typical HTTP/1.1 usage waits for one response before sending the next request on it. HTTP/2 lets several requests be in progress simultaneously, using stream IDs to match interleaved response data to the correct request. Keep-alive provides reuse; multiplexing adds concurrency.
One TCP connection
├─ stream 1 → HTML
├─ stream 2 → CSS
├─ stream 3 → image
└─ stream 4 → API
Core idea: HTTP/2 multiplexes multiple HTTP exchanges over one connection.