7. NetworkingHTTP/1.1 vs 2 vs 3
HTTP/1.1 vs 2 vs 3
HTTP is the request-and-response language browsers and servers speak: “give me this page”, “here it is, status 200”. The versions differ mainly in how they move many requests at once. HTTP/1.1 handles one request at a time per connection, so browsers open several connections to work around it. HTTP/2 interleaves many requests over a single TCP connection, but because TCP delivers bytes strictly in order, one lost packet stalls every request on it, which is called head-of-line blocking. HTTP/3 runs over QUIC instead, where each request is an independent stream, so a loss only delays the stream it belongs to, and connection setup is quicker too.
In this lesson: A network waterfall showing multiplexing and head-of-line blocking.