Part of the Cloudflare ecosystem · 20 projects
This module allows you to securely clear your Cloudflare cache directly from your Drupal site. It supports various purging methods like clearing everything, by URL, cache tag, prefix, and hostname. You can automate purges and manage credentials securely, including options for using the Key module or `settings.php`.
Cloudflare Purge clears the Cloudflare cache from the Drupal admin or from Drush. It is for site owners and admins whose site sits behind Cloudflare.
You can purge one URL, a cache tag, a prefix, a hostname or the whole zone. The module can also purge changed cache tags automatically, once you turn that on.
Start here
- Read the Key module documentation if you want to store the Cloudflare credentials with the Key module
Features
- Manual purging: Under Configuration → Cloudflare Purge, the pages "Purge by URL", "Purge by Cache Tag", "Purge by Prefix", "Purge by Hostname" and "Purge Everything" each run one kind of purge.
- Credentials: The "Credentials" page takes either a Cloudflare API token (the default) or the older email and API key. You can keep the values in saved configuration, in the Key module, or in a
cloudflare_purge_credentialsarray in settings.php with the keyszone_idandbearer_token, oremailandauthorization. - Automatic purging: On "Auto-Purge Settings", tick "Enable automatic cache tag purging". It is off by default. "Entity Types for Automatic Purging" and "Cache Tag Prefix" decide which tags are sent.
- Purge the entire zone on cache flush: "Purge entire zone when all caches are flushed" is off by default. Turn it on only if you want every Drupal cache flush to clear the whole Cloudflare zone.
- Queue: "Use queue for automatic purging" sends tags through a queue instead of purging during the request. "Discard queued items older than the configured TTL" and "Maximum queue item age (seconds)" (default 900) drop old items. The "Queued Tags" page shows what is waiting.
- Cache-Tag header controls: "Emit only purgeable tags in the Cache-Tag header", "Hash cache tags", "Hashed tag length" and "Maximum header size (bytes)" control what the Cache-Tag header contains and how large it can get.
- Rate limiting: "Enable rate limiting" and "Maximum requests per minute" (default 60) limit how fast the module calls Cloudflare. It is off by default.
- History and logging: "Purge History" lists past purges. "Purge history entries to display" sets how many (default 100), and "Enable detailed logging" adds log messages. An administrator can clear the history.
- Plans & Limits: A page with this name in the same menu.
- Drush: Six commands:
cloudflare:purge-all(cf-purge-all),cloudflare:purge-url(cf-purge-url),cloudflare:purge-tags(cf-purge-tags),cloudflare:purge-prefixes(cf-purge-prefixes),cloudflare:purge-hostnames(cf-purge-hosts) andcloudflare:status(cf-status). - Batching: Large purge requests are split into batches before they are sent to Cloudflare.
Permissions
- "Administer Cloudflare Purge" opens the credentials and settings pages and can clear the history. It is marked restricted.
- "Perform manual Cloudflare purge operations" allows the URL, tag, prefix and hostname purges.
- "Purge entire Cloudflare cache" allows "Purge Everything". It is marked restricted.
- "View Cloudflare purge history" opens "Purge History".
- The landing page at
/admin/config/cloudflare-purgeopens for anyone who holds any one of these four permissions.
Installation: get started in 3 steps
- Install the module with Composer:
composer require drupal/cloudflare_purge - Enable it on the Extend page, or with Drush. See Installing modules if you need the steps:
drush en cloudflare_purge - Open "Credentials" under Configuration → Cloudflare Purge and enter your Cloudflare zone ID and credentials. Then open "Purge by URL" and purge one page to confirm it works.
Requirements
- Drupal 10, 11 or 12
- PHP 8.1 or later
- A Cloudflare account with the site's zone
The module needs no other Drupal module. The Key module is optional and only needed if you choose it as the storage method.
Cloudflare Purge is an independent project and is not affiliated with Cloudflare, Inc.
Support and maintenance
Questions, ideas, and bug reports are welcome. Please use this project’s issue queue so discussions and solutions remain available to the Drupal community.
Maintainers monitor issues, but response times depend on availability.
Developed and maintained by Alaa Haddad of Flash Web Center, LLC.
AI disclosure: AI tools assisted with drafting and reviewing this project description. The maintainer verified the final content against the project source.
Ask your assistant about Cloudflare Purge
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- system Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
More in the Cloudflare ecosystem
Most installed first
Activity
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 3.1.7 | Stable | 10–11 | PHP ^8.1 | Nov 29, 2026 | |
| 3.1.6 | Stable | 10–11 | PHP ^8.1 | Nov 3, 2026 | |
| 3.1.5 | Stable | 10–11 | PHP ^8.1 | Oct 12, 2026 | |
| 3.1.4 | Stable | 10–11 | PHP ^8.1 | Oct 6, 2026 | |
| 3.1.3 | Stable | 10–11 | Aug 21, 2026 | ||
| 3.1.2 | Stable | 10–11 | Jul 26, 2026 | ||
| 3.1.1 | Stable | 10–11 | Jul 4, 2026 | ||
| 3.1.0 | Stable | 10–11 | Jun 15, 2026 | ||
| 3.1.x-dev | Dev | 10–11 | Jun 15, 2026 | ||
| 3.0.7 | Stable | 10–11 | May 23, 2026 |