Cloudflare Purge clears your Cloudflare CDN cache from Drupal — by URL, by cache tag, by path prefix or by hostname — and it wires Drupal's own cache tags straight through to Cloudflare so the right pages clear themselves when content changes. It runs on Drupal 10, 11 and 12, depends only on core, and ships Drush commands for scripted and scheduled purging.
The problem it solves
Putting Cloudflare in front of a Drupal site is the easiest performance win available. The difficulty arrives immediately afterwards: an editor publishes a correction, and the old page keeps serving from the edge for hours.
The usual workarounds are both bad. Purging everything on every save throws away your entire cache and sends every visitor back to origin. Setting a short TTL means you barely cached anything in the first place.
Cloudflare Purge takes the precise route: when Drupal invalidates a cache tag, the module translates that into a targeted Cloudflare purge. The pages that changed clear. Everything else stays cached.
Four ways to purge
| Method | Use it for |
|---|---|
| By URL | Clearing one page, or a handful you name |
| By cache tag | Everything affected by one entity — the node, the listings it appears in, the menus that link to it |
| By prefix | A whole section of the site, such as everything under a path |
| By hostname | One domain on a multi-domain or multisite setup |
Purging by cache tag is the one that matters most, because it is the method that maps onto how Drupal already thinks about invalidation.
Automatic cache tag integration
Drupal already knows exactly what to invalidate when content changes — that is what cache tags are for. Cloudflare Purge listens for those invalidations and forwards them, so in normal operation you do not purge anything by hand. An editor saves a node; the affected pages clear at the edge.
Purges are queued and batched rather than fired one API call at a time. On a busy site a single content change can invalidate many tags at once, and batching keeps you inside Cloudflare's API limits instead of hitting them during your busiest hour.
Drush commands
Every purge method is available from the command line, which is what you want for deployments, cron jobs and scripted maintenance:
drush cloudflare:purge-all
drush cloudflare:purge-url
drush cloudflare:purge-tags
drush cloudflare:purge-prefixes
drush cloudflare:purge-hostnames
cloudflare:purge-all is the blunt instrument — useful straight after a deployment that changed templates or CSS, and the wrong tool for an editorial change.
Requirements
| Requirement | Value |
|---|---|
| Drupal core | ^10 || ^11 || ^12 |
| Dependencies | Drupal System only — no contributed modules required |
| Cloudflare | An account with API access to the zone you are purging |
The single-dependency design is deliberate. You do not need the Purge module and its plugin ecosystem to use this; it stands on its own.
Installation
composer require drupal/cloudflare_purge
drush en cloudflare_purge -y
drush cr
Then add your Cloudflare credentials in the module's settings form and confirm the zone.
On credentials: treat your Cloudflare API token like any other production secret. Scope it to the minimum permission it needs — cache purge on one zone — rather than using an account-wide key, so a leak cannot be used to change your DNS.
Common questions
Does it work on Drupal 12?
Yes — ^10 || ^11 || ^12.
Do I need the Purge module?
No. Cloudflare Purge depends only on Drupal core's System module.
Will it purge everything every time someone saves a node?
No, and that is the point. It forwards Drupal's cache tag invalidations, so only the pages affected by that change are cleared.
What happens if Cloudflare's API is unavailable?
Purges are queued, so work is not lost the instant an API call fails. A persistent backlog is a signal worth watching — it usually means credentials or rate limits, not Drupal.
Related projects
- Acquia Purge Varnish — API V2 — the same idea for Acquia Cloud's Varnish layer.
- Module Matrix — audit what is installed across your sites.
Running Drupal at scale?
Cloudflare Purge is free and GPL-licensed. Cache invalidation is one of those problems that looks solved until traffic arrives — if you want help getting caching, CDN and performance right on a production Drupal site, see my Drupal services or get in touch.