Connection

The HTTP Connection header controls whether the network connection stays open after the current transaction completes.

Usage

The Connection header is a hop-by-hop header in HTTP/1.1 used to manage the lifecycle of the underlying TCP connection. A client or server includes this header to signal whether the connection persists for additional requests or closes after the current exchange.

In HTTP/1.1, persistent connections are the default behavior. Sending Connection: keep-alive is technically redundant but remains common in practice. The Keep-Alive header works alongside the Connection header to set timeout and request limits on persistent connections.

The Connection header also serves a second role: listing hop-by-hop header field names present in the message. Intermediaries (proxies, gateways) remove any header listed in the Connection value before forwarding the message to the next hop.

Directives

keep-alive

The keep-alive directive signals the sender wants the connection to remain open for subsequent requests. This is the default in HTTP/1.1. When present, the Keep-Alive header provides parameters like idle timeout and maximum request count.

close

The close directive tells the other party to close the connection after completing the current request-response pair. In HTTP/1.0, closing after each transaction was the default behavior.

Example

A client sends a request with an explicit keep-alive directive. This tells the server to hold the TCP connection open after delivering the response.

GET /api/status HTTP/1.1
Host: api.example.re
Connection: keep-alive

A server signals the connection will close after delivering this response. The client opens a new TCP connection for the next request.

HTTP/1.1 200 OK
Content-Type: application/json
Connection: close

The Connection header also lists hop-by-hop headers. In this example, the proxy strips the X-Debug-Token header before forwarding the message.

GET /resource HTTP/1.1
Host: example.re
Connection: keep-alive, X-Debug-Token
X-Debug-Token: abc123

Crawlers and Connection

Verified crawler probe

Probe data from verified crawler traffic (September 2026 snapshot) shows which bots send Connection when requesting pages. Yes marks the header on at least nine of ten sampled requests from the bot, Sometimes marks a smaller share, and No marks absence.

Crawler Sends Connection
Amazonbot Yes
Applebot No
Baiduspider No
Bingbot No
ClaudeBot No
DuckDuckBot Yes
GPTBot No
Googlebot Yes
Googlebot (smartphone) Yes
Googlebot-Image Yes
Meta-ExternalAgent No
Meta-WebIndexer No
OAI-SearchBot No
SeznamBot Yes
YandexBot Sometimes
YandexFavicons No

See also

Last updated: September 21, 2026