instantclick
instantclick copied to clipboard
Add retry on 504 responses and other kinds of timeouts
When instantclick makes a GET request to a URL and receives a 504 Gateway Timeout
response or otherwise times out, it should retry the request N times (ideally with some kind of exponential backoff to avoid hammering the server).
The benefit of this is that it will smooth out some kinds of transient errors due to network issues outside of our control.
Retrying requests on failures would complicate the code a fair bit. What I’m currently considering is to redirect outside of InstantClick (via location.href = …
) for HTTP codes other than 2xx.