1 min readMar 29, 2026by jakub
CloudFlare Cache Cleaner
Managing CloudFlare cache alongside Magento deployments usually means switching to the CloudFlare dashboard or writing custom API scripts. This module brings cache purging directly into Magento's CLI, so you can clear caches as part of your deployment pipeline without leaving the terminal.
Particularly useful for stores that use CloudFlare as a CDN and need granular cache invalidation — not just "purge everything" but targeted purging by URL patterns, cache tags, hostnames, or URL prefixes.
GitHub: qoliber/m2-cloudflare-cache-cleaner
Installation
Bash
composer require qoliber/module-cloudflare-cache
bin/magento setup:upgradeRequires Composer 2.x. Works immediately after installation — just configure your CloudFlare API credentials in the Magento admin.
Purge Methods
| Method | Use case |
|---|---|
| By URL/file | Purge specific product pages, category pages, or CMS pages after content updates |
| By tag | Purge all pages sharing a cache tag (e.g. all pages showing a specific product) |
| By host | Purge an entire subdomain or hostname — useful for multi-store setups |
| By prefix | Purge all URLs under a path (e.g. /catalog/ or /checkout/) |
Integration with Deployments
Add cache purging to your deployment scripts:
Bash
# After deploying new static content
bin/magento cloudflare:cache:purge --by-prefix="/static/"
# After CMS content update
bin/magento cloudflare:cache:purge --by-url="https://store.com/about-us"
# Nuclear option — purge everything
bin/magento cloudflare:cache:purge --allWas this page helpful?