How to Purge xCloud Cloudflare Enterprise Cache Automatically in WordPress
I know how annoying this one is. You edit a page and purge Cloudflare, the purge reports success, and visitors still see the old version for up to an hour.
On an xCloud site with the Cloudflare Enterprise add-on, that purge goes to the wrong place. Your pages are cached in xCloud’s own Cloudflare zone, not in yours. My advice is simple: install xCloud’s automatic cache purge, then let GT Performance send every purge through it.
GT Performance is my free WordPress performance plugin for page caching, CSS and JavaScript optimization and edge purging. From version 1.3.6 it detects xCloud’s purge plugin on its own and routes every purge to Cloudflare Enterprise, with no API token to set up.
I found this problem on my own site, which runs on xCloud with the Cloudflare Enterprise add-on. Cloudflare accepted purges by URL, by prefix and even “purge everything” on my zone, and the cached page kept its age every time.
Why Your Cloudflare Purge Does Nothing
An Enterprise domain on xCloud is a DNS-only CNAME that points to edge.xcloud.app. Requests go through xCloud’s Cloudflare account, where the add-on runs, and never touch the zone in your own Cloudflare account.
So these purges all return success and clear nothing a visitor receives:
- the Purge Cache button in your Cloudflare dashboard
- a Cloudflare API call made with your own token
- any WordPress plugin connected to your Cloudflare zone, including GT Performance’s direct Cloudflare integration before 1.3.6
The cached copy then expires on its own schedule. On my site the edge kept HTML for up to an hour, because the origin sends s-maxage=3600.
How to Check Which Zone Serves Your Site
Two quick checks tell you whether this applies to you.
- Open the DNS records for your domain. If the root and
wwwrecords are CNAMEs toedge.xcloud.appwith the proxy off (gray cloud), xCloud serves the site. - Request a page and look at the
ageheader. Then purge that page from your Cloudflare dashboard and run the same command again.
curl -sI https://example.com/some-page/ | grep -iE "cf-cache-status|age"
If age keeps climbing after the purge, the copy lives in a cache your purge can’t reach.
Before You Start
Check these first:
- An active Cloudflare Enterprise add-on in xCloud, with both the domain and SSL showing Active.
- GT Performance 1.3.6 or newer. Older versions can’t see xCloud’s purge plugin.
- Access to xCloud and wp-admin for the site.
- WP-CLI, only if you want to purge from the command line.
Install xCloud’s Automatic Cache Purge
xCloud ships its own small purge plugin for WordPress sites. It goes into mu-plugins, carries a token pair for your site and purges a post’s own URL when you save it.
- In xCloud, open your site and choose Cloudflare Enterprise from the site menu.
- If the page shows Auto cache purge is not installed, click Install now.
- Wait for the warning to disappear. The file
wp-content/mu-plugins/xcloud-cfe-cache-purge.phpis now on your server.
xCloud covers this step in its guide to activating the Cloudflare Enterprise add-on.
On its own, xCloud’s plugin only clears the saved post’s URL. Your home page, category archives and anything a menu, Page Blocks or theme edit changes still stay cached until they expire.
Let GT Performance Purge Cloudflare Enterprise
GT Performance needs no setup for this. When it finds xCloud’s purge plugin with a usable token, it does three things on its own:
- sends every purge it makes to xCloud’s endpoint, in the same format xCloud’s plugin uses
- pauses its direct Cloudflare integration and keeps your settings, because that integration purges a zone nobody is served from
- shows Enterprise purge: Automatic on its Integrations screen
You can confirm it from WP-CLI:
wp gt-performance xcloud status
wp gt-performance doctor
xcloud status should show enterprise_purge=xcloud-plugin, and doctor should show Cloudflare as paused (xCloud Enterprise).
The tokens stay on your server. GT Performance only sends them to an HTTPS address on xcloud.host, so a changed setting can’t send them anywhere else.
What Gets Purged and When
This is what each change sends to Cloudflare Enterprise once both plugins are in place:
| Change | What Cloudflare Enterprise clears |
|---|---|
| Saving, unpublishing or trashing a post | The post, home, its post type archive, author archive and category and tag archives, plus pages recorded as listing the post |
| A new or approved comment | The post, home and its post type archive, plus pages listing the post |
| Menu, Page Blocks or theme edits that GT Performance purges | Every page GT Performance clears |
Purge GT cache, or wp gt-performance cache purge | The whole Enterprise cache |
wp gt-performance xcloud purge --page-url=<url> | That one page |
Automatic purges go out at the end of the request without waiting for xCloud, so saving a post stays fast. The Purge GT cache button and WP-CLI wait for xCloud’s reply and tell you if it rejects the request.
Large Purges
xCloud drops a purge of more than 300 URLs instead of clearing part of it. GT Performance works around that limit. When a post save names more than 300 pages, Enterprise gets only the post’s own URLs, and the listing pages are cleared from GT Performance’s cache only. Those refresh at the edge when their copies expire.
The limit comes up more often than you’d expect. A single post save on my site used to name about 500 URLs, most of them pages with long sidebars and docs navigation.
Purge One Page or the Whole Site
Two commands cover most needs:
# One page
wp gt-performance xcloud purge --page-url=https://example.com/pricing/
# The whole site, at the origin and at Cloudflare Enterprise
wp gt-performance cache purge
You should use --page-url, not --url, because WP-CLI reserves --url for choosing a site. In wp-admin, Purge GT cache under GT Performance > Dashboard does the same as the second command.
Check That the Purge Worked
Run the curl check from earlier right after a purge. A fresh copy shows age: 0, or no age header at all.
On my site the age of a calculator page went from 15 seconds to 0 straight after wp gt-performance xcloud purge.
To see what WordPress renders right now, add a throwaway query string such as ?nocache=1. GT Performance skips its cache for unknown query strings and sends no-store, so the edge passes that request through as well.
The Limits
A few things are worth knowing before you rely on it:
- No purge plugin, no Enterprise purge. xCloud’s Public API token can read Enterprise analytics but has no purge action. Without the plugin, use the Purge control on xCloud’s Cloudflare Enterprise page.
- Page two and later of a listing wait. A post save purges page one of each listing. Later pages refresh when their copy expires, within an hour by default.
- Removing xCloud’s plugin turns direct Cloudflare back on. That is right only if you have moved off Enterprise.
- Stores need a check first. Before you turn on Edge Page Caching in xCloud, ensure your cart, checkout and account pages come back with
no-store.
FAQs on xCloud Cloudflare Enterprise Cache
Why does Cloudflare say the purge succeeded when the page is still old?
The purge ran on your own Cloudflare zone. An xCloud Enterprise site is served from xCloud’s zone, so your zone had nothing to clear.
Do I need an xCloud API token?
No, not for purging. GT Performance purges Cloudflare Enterprise through xCloud’s purge plugin alone. A token adds xCloud’s host page cache purge and the 12-hour Enterprise traffic numbers.
Can I purge by URL from the xCloud dashboard?
Yes. xCloud’s Purge Cache dialog accepts up to 30 URLs or Cache-Tags per request, or a full purge. It’s manual, so it suits a one-off fix better than daily publishing.
Does xCloud’s plugin work without GT Performance?
Yes, for the saved post’s own URL. GT Performance adds the archives, listings and every other purge it already makes.
Final Remarks
If your edits on xCloud Cloudflare Enterprise lag behind, I’d check the DNS record first. When it’s a gray-cloud CNAME to edge.xcloud.app, I’d install xCloud’s automatic cache purge and update GT Performance to 1.3.6. The purges you already make then start reaching the edge.
The full reference, including every setting and hook, is in the xCloud docs for GT Performance.