HTTP keep-alive: Reusing connections across HTTP versions
HTTP keep-alive reuses a network connection for multiple HTTP requests. HTTP/1.1 connections persist by default; HTTP/2 and HTTP/3 multiplex streams on one connection. Adding Connection: keep-alive is usually unnecessary, and a connection does not preserve an application login session.
HTTP keep-alive reuses a network connection for multiple HTTP requests. HTTP/1.1 connections persist by default; HTTP/2 and HTTP/3 multiplex streams on one connection. Adding Connection: keep-alive is usually unnecessary, and a connection does not preserve an application login session.
HTTP/1.0 normally closes after a response, though it had a historical Keep-Alive extension. HTTP/1.1 stays open unless closed; Connection: close requests closure after the current response. HTTP/2 and HTTP/3 prohibit connection-specific fields such as Connection and Keep-Alive; intermediaries translating HTTP/1.x must remove them. For HTTP/1.1 reuse, frame message boundaries correctly and consume the current body fully. HTTP/2 streams share TCP flow-control and loss effects. Idle limits, deployments, resource pressure, or network faults can close any connection.
Treat closure as normal and reconnect when needed. Decide retries separately: blindly repeating a non-idempotent operation may duplicate a payment or order if the server already processed it. Consider method semantics, operation idempotency, and server deduplication.
Verify
Check the negotiated HTTP version and connection details in browser tools, then use server or proxy logs to see whether sequential requests reused a connection. Retest after idle time because limits vary. Consume bodies fully, verify message boundaries, and never add Connection or Keep-Alive to HTTP/2 or HTTP/3. A different visible connection is not automatically an error; proxies and pools manage each network hop separately.
Sources
[RFC 9112: HTTP/1.1](https://www.rfc-editor.org/rfc/rfc9112.html)
[RFC 9110: HTTP Semantics](https://www.rfc-editor.org/rfc/rfc9110.html#section-7.6.1)
[RFC 9113: HTTP/2](https://www.rfc-editor.org/rfc/rfc9113.html)
[RFC 9114: HTTP/3](https://www.rfc-editor.org/rfc/rfc9114.html)