Retry a few times with exponential backoff and jitter, honouring
Retry-AfterRetry a few times with exponential backoff and jitter, and honour Retry-After. Backoff means each wait is longer than the last. Jitter adds a small random amount to each wait. Together they spread retries out, so many clients do not hit a struggling server at the same moment. A cap on the number of retries stops endless retrying. "Retry immediately in a tight loop" and "Retry every 1 second forever" are the tempting wrong answers. When many clients retry like this, the outage gets worse.
Read more