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 1111807 of Retry-After

  • Revision slug: Web/HTTP/Headers/Retry-After
  • Revision title: Retry-After
  • Revision id: 1111807
  • Created:
  • Creator: fscholz
  • Is current revision? Yes
  • Comment fix github url

Revision Content

{{HTTPSidebar}}

The Retry-After response HTTP header indicates how long the user agent should wait before making a follow-up request. There are two main cases this header is used:

  • When sent with a {{HTTPStatus(503)}} (Service Unavailable) response, it indicates how long the service is expected to be unavailable.
  • When sent with a redirect response, such as {{HTTPStatus(301)}} (Moved Permanently), it indicates the minimum time that the user agent is asked to wait before issuing the redirected request.
Header type {{Glossary("Response header")}}
{{Glossary("Forbidden header name")}} no

Syntax

Retry-After: <http-date>
Retry-After: <delay-seconds>

Directives

<http-date>
A date after which to retry. See the {{HTTPHeader("Date")}} header for more details on the HTTP date format.
<delay-seconds>
A non-negative decimal integer indicating the seconds to delay after the response is received.

Examples

Dealing with scheduled downtime

Support for the Retry-After header on both clients and servers is still inconsistent. However, some crawlers and spiders, like the Googlebot, honor the Retry-After header. It is useful to sent it along with a {{HTTPStatus(503)}} (Service Unavailable) response, so that search engines will keep indexing your site when the downtime is over.

Retry-After: Wed, 21 Oct 2015 07:28:00 GMT
Retry-After: 120

Specifications

Specification Title
{{RFC("7231", "Retry-After", "7.1.3")}} Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content

Browser compatibility

{{Compat}}

See also

Revision Source

<div>{{HTTPSidebar}}</div>

<p>The <strong><code>Retry-After</code></strong> response HTTP header indicates how long the user agent should wait before making a follow-up request. There are two main cases this header is used:</p>

<ul>
 <li>When sent with a {{HTTPStatus(503)}} (Service Unavailable) response, it indicates how long the service is expected to be unavailable.</li>
 <li>When sent with a redirect response, such as {{HTTPStatus(301)}} (Moved Permanently), it indicates the minimum time that the user agent is asked to wait before issuing the redirected request.</li>
</ul>

<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">
Retry-After: &lt;http-date&gt;
Retry-After: &lt;delay-seconds&gt;
</pre>

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

<dl>
 <dt>&lt;http-date&gt;</dt>
 <dd>A date after which to retry. See the {{HTTPHeader("Date")}} header for more details on the HTTP date format.</dd>
 <dt>&lt;delay-seconds&gt;</dt>
 <dd>A non-negative decimal integer indicating the seconds to delay after the response is received.</dd>
</dl>

<h2 id="Examples">Examples</h2>

<h3 id="Dealing_with_scheduled_downtime">Dealing with scheduled downtime</h3>

<p>Support for the <code>Retry-After</code> header on both clients and servers is still inconsistent. However, some crawlers and spiders, like the Googlebot, honor the <code>Retry-After</code> header. It is useful to sent it along with a {{HTTPStatus(503)}} (Service Unavailable) response, so that search engines will keep indexing your site when the downtime is over.</p>

<pre>
Retry-After: Wed, 21 Oct 2015 07:28:00 GMT
Retry-After: 120
</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Title</th>
  </tr>
  <tr>
   <td>{{RFC("7231", "Retry-After", "7.1.3")}}</td>
   <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td>
  </tr>
 </tbody>
</table>

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

<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>

<p>{{Compat}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li><a href="https://webmasters.googleblog.com/2011/01/how-to-deal-with-planned-site-downtime.html">Google Webmaster blog: How to deal with planned site downtime</a></li>
 <li>{{HTTPStatus(503)}} (Service Unavailable)</li>
 <li>{{HTTPStatus(301)}} (Moved Permanently)</li>
</ul>
Revert to this revision