Wait 1s, 2s, 4s Between Retries, and Only Retry Safe Methods
A request that fails with a 5xx status or a timeout might succeed if sent again. The cause may be a temporary problem on the server or the network rather than a problem with the request itself.
Exponential backoff widens the gap between retries: 1 second, 2 seconds, 4 seconds, and so on. Retrying at once would pile more load on top of the load that caused the failure, so the client waits before retrying.
Whether a retry is allowed depends on the method's idempotency. GET, PUT, and DELETE can be retried, because repeating them doesn't change the result. POST can't be retried this way without an idempotency key, because a plain retry by the client risks the server creating a second resource.
Explain how exponential backoff spaces out retries, and which HTTP methods a client can safely retry without an idempotency key.
A GET request times out. Is retrying it, without any special mechanism, safe?