The Connection
general header controls whether or not the network connection stays open after the current transaction finishes. If the value sent is keep-alive
, the connection is persistent and not closed, allowing for subsequent requests to the same server to be done.
Except for the standard hop-by-hop headers (Keep-Alive
, Transfer-Encoding
, TE
, Connection
, Trailer
, Upgrade
, Proxy-Authorization
and Proxy-Authenticate
), any hop-by-hop headers used by the message must be listed in the Connection
header, so that the first proxy knows he has to consume them and not to forward them further. Standard hop-by-hop headers can be listed too (it is often the case of Keep-Alive
, but this is not mandatory.
Header type | General header |
---|---|
Forbidden header name | no |
Connection: keep-alive Connection: close
close
keep-alive
only]Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | Servo |
---|---|---|---|---|---|---|---|
Connection | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
Feature | Android | Chrome for Android | Edge Mobile | Firefox for Android | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Connection | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection