Skip to main content

How to Use Breeze Cloudflare Integration for Cache Purging

Learn how to use Breeze Cloudflare Integration for cache purging to keep your WordPress site updated, & always serving fresh content to all.

Syed Abuzar Mehdi avatar
Written by Syed Abuzar Mehdi
Updated over a month ago

If your WordPress site uses Cloudflare CDN, the Breeze plugin can help you clear cached files directly from your WordPress dashboard.

This ensures that your visitors always see the latest content, without having to log in to Cloudflare every time you make a change.

In this article, you’ll learn how Breeze integrates with Cloudflare, how to enable this feature, and how it works behind the scenes.


Table of Contents:


How to Use Breeze Cloudflare Integration for Cache Purging?

The Cloudflare integration in Breeze allows you to automatically or manually purge CDN cache when you update your WordPress content.

This helps ensure your visitors always see the most up-to-date version of your site without delays.

CDN

Breeze offers support for Content Delivery Networks (CDN). Instead of using the CDN providers' plugins, you can use Breeze to integrate your CDN. Here's how you can integrate one.

Breeze supports Cloudflare Enterprise and offers 1-click integration and you don’t require any special configuration within Breeze for it to work. However, if you want to use your own CDN you can follow this guide.

Varnish

Breeze offerings include Varnish Cache configuration to make your website robust. You don't require any modification here as all the settings are pre-configured.

  1. Auto Purge Varnish — We recommend that you keep this option enabled at all times to automatically purge Varnish cache on actions like publishing new blog posts, pages, and comments.

  2. Varnish Server — This is the default pre-installed Varnish server IP address of Cloudways servers.

  3. Purge Varnish Cache — You can also manually purge the entire cache instantly by pressing this button.

Finally, click Save Changes.

How to Use Breeze Cloudflare Integration to Purge CDN Cache Automatically?

The Breeze Cloudflare integration allows you to purge cache (i.e., remove outdated files) from Cloudflare’s edge servers whenever your site content changes, like when you update a post, page, or switch themes.

This ensures your visitors always get the freshest version of your site.

Step 1: Enable Cloudflare Cache Purge in wp-config.php

To activate the Cloudflare options in Breeze, you must first define two constants in your wp-config.php file:

define( 'CDN_SITE_ID', 'YOUR_SITE_ID_HERE' );

define( 'CDN_SITE_TOKEN', 'YOUR_SITE_TOKEN_HERE' );

These values are used to authenticate and connect with the Breeze Cloudflare microservice.

If these values are not defined, the Breeze plugin will not show Cloudflare options, and cache purging won’t work.

Step 2: Define Environment for Cloudflare Endpoint

Breeze also needs to know which Cloudflare microservice URL to use. This is controlled through a third value:

getenv( 'FPC_ENV' )

This environment variable helps Breeze determine which platform you’re on — Flexible (FP) or Autoscale (FMP) — and selects the correct purge endpoint.

If CDN_SITE_ID, CDN_SITE_TOKEN, and FPC_ENV are not properly defined, the Cloudflare module will remain disabled in Breeze.

What Happens When Cache is Purged?

Once configured, Breeze can purge Cloudflare cache in two ways:

Automatically:

  • When you switch themes, Breeze automatically purges the entire Cloudflare cache.

Manually or on demand:

  • When you update posts, pages, or custom post types

  • When you click "Purge CF Cache" in the Breeze UI (if implemented)

How Breeze Talks to Cloudflare (Behind the Scenes)

Breeze uses the following helper functions and endpoints to communicate with Cloudflare's microservice:

Helper Functions:

  • reset_all_cache() – Purges cache for the entire domain (or all subsites in a multisite).

  • purge_cloudflare_cache_urls() – Clears cache for specific URLs (like posts or pages).

Endpoints:

  • purge-fpc-domain – Clears cache for the whole domain.

  • purge-fpc-sub-dir – Clears cache for a sub-site (in a multisite with subfolders).

  • purge-fpc-url – Clears cache for specific URLs.

Enable Debug Mode for Cloudflare Cache Logs (Optional)

For developers or advanced users, Breeze provides a debug mode to check Cloudflare cache purge requests.

To enable debug logging, add the following line to wp-config.php:

define( 'BREEZE_CF_DEBUG', true );

Once enabled, Breeze will log Cloudflare-related actions so you can troubleshoot any issues.

What Data Is Sent When Cache Is Cleared?

When Breeze sends a request to Cloudflare, it includes the following information:

$data_to_send = array(
$data_to_send = array(
'urls' => <URLs list to purge>,
'appToken' => CDN_SITE_TOKEN,
'appId' => CDN_SITE_ID,
'platform' => ‘fp or fmp’,
);

This ensures that only the correct files are purged from Cloudflare — no manual work needed.


That’s it! We hope this article was helpful.

Need Help?

If you need assistance, feel free to:

We're here 24/7 to help you!


Did this answer your question?