Skip to content

Adds configurable automatic retries for API failures - #62

Merged
SergkeiM merged 1 commit into
masterfrom
feature/max-retries
Aug 14, 2026
Merged

SergkeiM merged 1 commit into
masterfrom
feature/max-retries

Conversation

@SergkeiM

Copy link
Copy Markdown
Owner

Introduces a maxRetries option to ClientOptions, enabling automatic retries for transient Cloudflare API failures.

  • Retries are applied to connection failures, HTTP 408 (Request Timeout), 409 (Conflict), 429 (Too Many Requests), and all 5xx server errors.
  • Implements an exponential backoff strategy with full jitter, capping at 8 seconds, and respects Cloudflare's Retry-After header when present.
  • Provides a new configuration option CLOUDFLARE_MAX_RETRIES for Laravel users and updates documentation with details on retry behavior, supported statuses, and configuration examples.
  • Ensures user-defined Guzzle middlewares execute on every retry attempt, providing full insight into the request lifecycle.
  • Includes a cautionary note regarding the idempotency of retried POST requests after a 5xx error.

@SergkeiM
SergkeiM merged commit 982670b into master Aug 14, 2026
8 checks passed
@SergkeiM
SergkeiM deleted the feature/max-retries branch August 14, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant