Retry-After - HTTP 编辑

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

  • When sent with a 503 (Service Unavailable) response, this indicates how long the service is expected to be unavailable.
  • When sent with a 429 (Too Many Requests) response, this indicates how long to wait before making a new request.
  • When sent with a redirect response, such as 301 (Moved Permanently), this indicates the minimum time that the user agent is asked to wait before issuing the redirected request.
Header typeResponse header
Forbidden header nameno

Syntax

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

Directives

<http-date>
A date after which to retry. See the 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 send it along with a 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

SpecificationTitle
RFC 7231, section 7.1.3: Retry-AfterHypertext Transfer Protocol (HTTP/1.1): Semantics and Content

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:93 次

字数:3940

最后编辑:6 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文