← All headersGeneral header

What is a Connection header?

Controls whether the network connection stays open after the current transaction, e.g. keep-alive or close.

Under HTTP/1.1, keeping a connection alive between requests avoids the overhead of a fresh TCP and TLS handshake for every asset a website loads, which is a big part of why modern pages feel fast. If a server or an intervening proxy mishandles Connection, visitors can see intermittent hangs or dropped requests that are hard to reproduce by hand - the sort of flaky behaviour a scheduled uptime check from multiple regions is far better positioned to notice than a person refreshing a page.

Common use case

Servers set Connection: close when shutting down or rotating a backend, so clients know not to reuse the socket for a follow-up request.

Example

Connection: keep-alive

History

Present in HTTP/1.0 (RFC 1945, 1996) and formalised as part of persistent connections in HTTP/1.1 (RFC 2068, 1997).

Deprecated / legacy status

It has no meaning in HTTP/2 or HTTP/3, which multiplex many requests over a single connection by design - sending it there is harmless but ignored, and the HTTP/2 spec explicitly forbids using it to control connection behaviour.