OptionalmaxMaximum delay in milliseconds accepted from the server for a single retry.
Enforces a ceiling on the Retry-After delay. Throws ConstraintError if exceeded.
OptionalretryableSet of HTTP status codes that should trigger automatic retries.
Defaults to the standard retryable status codes: 429, 503.
Override this to customize which status codes should be retried.
Factory function that creates a backoff strategy for retry delays.
The strategy determines additional jitter to add to the Retry-After delay and when to stop
retrying (by returning NaN). Total wait time is Retry-After + strategy.nextBackoff().
Wrap with upto() to limit retry attempts.
Configuration options for the withRetryAfter middleware.
Remarks
This middleware handles server-directed retry timing. When a server responds with
429or503and a validRetry-Afterheader, the middleware waits the specified duration before retrying. The backoff strategy adds optional jitter on top of the server-requested delay.See
RFC 9110 §10.2.3 - Retry-After