Q
Q
quest20172017-07-26 21:17:41
HTTP headers
quest2017, 2017-07-26 21:17:41

Does anyone use http header Retry-After? How?

https://developer.mozilla.org/en/docs/Web/HTTP/Hea...
Retry-After is an http header that contains an integer that indicates the delay in seconds. The server tells the client that the client needs to wait the specified number of seconds and retry the request. This is an additional field that can be specified at least for such http codes as: 202, 429, 503, 301, 307
At least in 2011 it already existed.
Support by browsers is not clear, whether they will use this delay transparently for js in some http codes. For example, a 301 redirect happens transparently for js.
In systems with many servers, this is relevant and I want to force the client to re-request with the same method transparently for the client. I have so far made a crutch in which for each REST request I have a separate js function in which, using XMLHttpRequest, I make a request, check the http return code and if it is say 202, then I take getResponseHeader('Retry-After') and use setTimeout to call this the same function with the same arguments again.
Do you use the same, how exactly and with what http code?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question