Skip to content

Add Cloudflare cache tag purging - #3

Merged
TorstenDittmann merged 3 commits into
mainfrom
agent/cloudflare-cache-tag-purge
Aug 11, 2026
Merged

Add Cloudflare cache tag purging#3
TorstenDittmann merged 3 commits into
mainfrom
agent/cloudflare-cache-tag-purge

Conversation

@TorstenDittmann

Copy link
Copy Markdown
Contributor

What changed

  • map the provider-neutral purgeKeys() operation to Cloudflare cache-tag purges
  • send cache tags to Cloudflare's /purge_cache endpoint in batches of 30
  • document Cloudflare cache-tag usage and add request/batching coverage

Why

The cache abstraction exposed key purging for Fastly, but the Cloudflare adapter rejected the same operation even though Cloudflare supports equivalent cache-tag invalidation. This prevented proxy fan-out from invalidating tagged content on Cloudflare.

Impact

Consumers can now call Cache::purgeKeys() with their shared invalidation identifiers and purge both Fastly surrogate keys and Cloudflare cache tags without changing the public API.

Validation

  • composer test — 26 tests, 49 assertions
  • composer lint
  • composer analyse

@TorstenDittmann
TorstenDittmann marked this pull request as ready for review August 11, 2026 15:21
@TorstenDittmann
TorstenDittmann force-pushed the agent/cloudflare-cache-tag-purge branch from cddd748 to 13e3fea Compare August 11, 2026 15:21
@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds Cloudflare cache-tag invalidation to the provider-neutral purgeKeys() operation.

  • Sends tag purge requests to Cloudflare’s zone-level purge_cache endpoint.
  • Splits tag lists into batches of 30 and preserves empty-input behavior.
  • Adds request-shape and batching tests and documents Cloudflare usage.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code defect identified.

The implementation follows the existing Cloudflare purge request pattern, handles empty inputs, batches tags conservatively, checks provider success responses, and is covered for payload shape and batch boundaries.

Important Files Changed

Filename Overview
src/Cdn/Cache/Adapter/Cloudflare.php Replaces the unsupported-operation response with batched Cloudflare cache-tag purge requests using the adapter’s established request and error handling.
tests/Cdn/Cache/Adapter/CloudflareTest.php Replaces the unsupported-operation test with coverage for tag payload construction and multi-request batching.
README.md Documents Cloudflare cache-tag support through the existing provider-neutral key-purge API.

Reviews (1): Last reviewed commit: "Merge branch 'agent/cloudflare-cache-tag..." | Re-trigger Greptile

@TorstenDittmann
TorstenDittmann merged commit 4209973 into main Aug 11, 2026
4 checks passed
@TorstenDittmann
TorstenDittmann deleted the agent/cloudflare-cache-tag-purge branch August 11, 2026 15:23
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