freecoding.school100% FREE · NO SIGNUP
Gateway RidgeISSUE #3 of 35

retry-after · backoff · idempotency

Gateway GusVSTimeout Titan
Gateway Gus saysOn failure, retry with exponential backoff and jitter — and only retry safe operations.

Transient errors (429, 503, timeouts) deserve a retry — but not immediately or all at once. Use exponential backoff (wait 1s, 2s, 4s…) plus random jitter so clients don't retry in lockstep (a "thundering herd"). Respect Retry-After. Only auto-retry idempotent requests (GET/PUT/DELETE) unless you use idempotency keys for POSTs.

Power-ups you unlock

Timeout Titan attacks — common mistakes

Boss battleSketch a backoff schedule with jitter for three retries.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>try 1 → fail → wait 1s ± jitter
try 2 → fail → wait 2s ± jitter
try 3 → fail → wait 4s ± jitter → give up</pre></body></html>
▶ Open the interactive comic issue
‹ Rate Limiting · Token Bucket · Sliding WindowIdempotency Keys · Safe Retries ›