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:upgrade

Requires Composer 2.x. Works immediately after installation — just configure your CloudFlare API credentials in the Magento admin.

Purge Methods

MethodUse case
By URL/filePurge specific product pages, category pages, or CMS pages after content updates
By tagPurge all pages sharing a cache tag (e.g. all pages showing a specific product)
By hostPurge an entire subdomain or hostname — useful for multi-store setups
By prefixPurge 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 --all
Was this page helpful?
CloudFlare Cache Cleaner — Magento 2 Modules — Open Source | qoliber Docs