HTTP headers are used to pass additional information with HTTP request or response. HTTP Retry-After header is an HTTP response header which indicates how long to wait before making another request. Depending on different status codes, there are different use cases of the Retry-After response header.
- Status code 503: 503 is used to indicate service unavailable. Retry-After is used with 503 which tells the user how long the service is expected to be unavailable. It is used to deal with scheduled downtime.
- Status code 301: 301 is used to indicate that resource is moved permanently. Retry-After is used with 301 which tells the user about the minimum for which user should wait before issuing the redirect request.
- Status code 429: 429 id is used to indicate too many request. Retry-After is used with 429 to tells the user how long to wait before making another request.
Retry-After: <http-date> Retry-After: <delay-seconds>
Directives: This header accepts two directives as mentioned above and described below:
- http-date: It indicated the date after which used should resend the request.
- delay-seconds: It is an integer value indicating the no of seconds after which user should resend the request.
Example: This example will illustrates the HTTP Retry-After header:
- Using date directive, after that date with the specified time client can retry the request.
Retry-After: Sun, 27 Oct 2019 09:45:00 GMT
- Using delay-second directive, after that specified second client can retry the request.
Supported Browsers: The browsers compatible with HTTP Retry-After header are listed below:
- Google Chrome
- Internet Explorer