Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1089205 of Connection

  • Revision slug: Web/HTTP/Headers/Connection
  • Revision title: Connection
  • Revision id: 1089205
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{HTTPSidebar}}

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 is not closed, allowing for subsequent requests to the same server to be done.

Header type {{Glossary("Response header")}}
{{Glossary("Forbidden header name")}} no

Syntax

Connection: keep-alive
Connection: close

Directives

close
Indicates that either the client or the server would like to close the connection. This is the default on HTTP/1.0 requests.
keep-alive
Indicates that the client would like to keep the connection open. This is the default on HTTP/1.1 requests.

Browser compatibility

{{Compat}}

Revision Source

<p>{{HTTPSidebar}}</p>

<p>The <strong><code>Connection</code></strong> general header controls whether or not the network connection stays open after the current transaction finishes. If the value sent is <code>keep-alive</code>, the connection is persistent and is not closed, allowing for subsequent requests to the same server to be done.</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">Header type</th>
   <td>{{Glossary("Response header")}}</td>
  </tr>
  <tr>
   <th scope="row">{{Glossary("Forbidden header name")}}</th>
   <td>no</td>
  </tr>
 </tbody>
</table>

<h2 id="Syntax">Syntax</h2>

<pre class="syntaxbox">
Connection: keep-alive
Connection: close
</pre>

<h2 id="Directives">Directives</h2>

<dl>
 <dt><code>close</code></dt>
 <dd>Indicates that either the client or the server would like to close the connection. This is the default on HTTP/1.0 requests.</dd>
 <dt><code>keep-alive</code></dt>
 <dd>Indicates that the client would like to keep the connection open. This is the default on HTTP/1.1 requests.</dd>
</dl>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p class="hidden">To contribute to this compatibility data, please write a pull request against this file: <a href="https://github.com/mdn/browser-compat-data/blob/master/http/headers.json">https://github.com/mdn/browser-compat-data/blob/master/http/headers.json</a>.</p>

<p>{{Compat}}</p>
Revert to this revision