Retry-After Header
Table of Content
The Retry-After response HTTP header indicates the time that the client must wait before attempting another request to a specific server. It is primarily used in instances where overload or maintenance is underway. This guide to system communications aids in managing server load and statutory downtime, thereby enhancing overall system performance and reliability.
Syntax
The Retry-After header can be defined in two ways:
Retry-After: <http-date>
Retry-After: <delay-seconds>
Directives
<http-date>
: This directive is specified in an HTTP-date format.<delay-seconds>
: This directive uses a nonnegative integer, representing the delay time in seconds.
Examples
Example of Retry-After header with HTTP-date:
Retry-After: Wed, 21 Oct 2015 07:28:00 GMT
Example of Retry-After header with delay seconds:
Retry-After: 120
Both examples instruct the client to repeat the request after the specified time.
Browser Compatibility
Browser | Compatibility |
---|---|
Chrome | Supported |
Firefox | Supported |
Safari | Supported |
Opera | Supported |
Edge | Supported |
How to modify Retry-After header
ModHeader is a Chrome extension that allows you to manipulate HTTP request headers. To modify the Retry-After header:
- Install the ModHeader extension from Chrome Web Store.
- Click on the ModHeader icon, then click on 'Add' to add a new header.
- In the 'Name' field, type 'Retry-After'. In the 'Value' field, either input the number of seconds the client should wait before reattempting or input the http-date when the client may try again.
- Refresh the page to apply the modified header.
Modifying Retry-After header with ModHeader can be very useful for testing the behavior of your web application in response to this header. This can help you ensure that your application handles the Retry-After header correctly, improving its reliability and robustness under various network conditions.