Skip to content

feat(api): add cache tag purging - #91

Merged
bencroker merged 1 commit into
putyourlightson:developfrom
boboldehampsink:feature/purge-cache-tags
Nov 24, 2026
Merged

bencroker merged 1 commit into
putyourlightson:developfrom
boboldehampsink:feature/purge-cache-tags

Conversation

@boboldehampsink

Copy link
Copy Markdown
Contributor

This adds Api::purgeTags(array $tags) for Craft sites that already tag their responses and decide when to invalidate them.

The method sends requests to Cloudflare's purge endpoint using the configured zone. It deduplicates tags and sends at most 100 per request. The return value indicates whether all requests succeeded, and HTTP and transport exceptions remain available to callers that handle retries.

Example

Cloudflare::$plugin->api->purgeTags(['news-overview']);

@bencroker
bencroker merged commit ca77e77 into putyourlightson:develop Nov 24, 2026
2 checks passed
@bencroker

Copy link
Copy Markdown
Contributor

Merged, thanks!

@bencroker

Copy link
Copy Markdown
Contributor

Released in 3.2.0.

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.

2 participants