A WordPress site sits behind Cloudflare for two years. Cache hit ratio is fine, p95 origin reads are fine, the team moves on. Then a project lead asks: “Should we move to BunnyCDN — it’s cheaper” or “Fastly lets us push logic to the edge — what would we gain?” The honest answer is that the edges are not interchangeable, and the rules that work on one vendor have a one-line equivalent, a ten-line equivalent, or no equivalent on another. The decisions are not made at the contract signing stage — they are made the first time a marketer asks for a logged-in preview that doesn’t get poisoned by the cache.
What’s happening
The three vendors approach edge logic from different angles. Cloudflare gives you Page Rules and Cache Rules in the UI, plus Workers (JavaScript on V8 isolates) for anything dynamic. BunnyCDN gives you Edge Rules (a declarative match/action engine in the UI) plus Edge Scripting (Workers-style JS, newer and less mature). Fastly gives you VCL — a domain-specific language inherited from Varnish — which is the most expressive of the three and also the most operationally demanding.
For WordPress specifically, the questions that matter are:
- Cache key composition. Default cache key includes host + path + query string. WordPress needs you to either include or exclude specific cookies (wordpress_logged_in_, woocommerce_cart_hash, comment_author_), pre-fragment by device class, and strip marketing query parameters (utm_*, fbclid, gclid). The hard part is doing this without exploding cardinality.
- Bypass cookies. Logged-in users and WooCommerce cart sessions must skip the cache entirely. The rule is “if cookie matches pattern X, fetch from origin and do not cache the response.”
- Stale-while-revalidate and stale-if-error. WordPress origin can be slow during plugin updates or cron bursts. Serving slightly stale HTML for thirty seconds while the edge re-fetches in the background hides a class of incidents.
- Origin shield and tiered cache. A single PoP that fronts all other PoPs reduces origin load by 60-90% for a typical publisher workload.
- Edge transforms. Rewriting image URLs to point at a media CDN, injecting nonce headers, signing URLs, A/B test cookie management.
Cloudflare Page Rules handle (1) and (2) shallowly — you can match on URL patterns and apply a cache-everything action, but cookie-based bypass needs a Worker. BunnyCDN Edge Rules cover (1), (2), and (3) declaratively but cannot do transforms without scripting. Fastly VCL covers all five, plus ESI (Edge Side Includes — fragment a page into cacheable + non-cacheable parts at the edge) which no other vendor in this comparison ships natively.
How to verify
Before changing anything, measure what the current edge is doing. On Cloudflare:
# pull cache analytics for the zone (requires API token with Analytics:Read)
curl -s "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/analytics/dashboard?since=-1440&until=0" \
-H "Authorization: Bearer $CF_TOKEN" \
| jq '.result.totals.requests, .result.totals.bandwidth'
# inspect cache headers on a representative URL
curl -sI https://example.com/some-article/ \
| grep -iE "cf-cache-status|age|cache-control|set-cookie|vary"
A healthy publisher front page should show cf-cache-status: HIT, an age measured in hundreds of seconds, and a cache-control directive that the edge respects.
For BunnyCDN, the equivalent comes from the Pull Zone analytics API:
curl -s "https://api.bunny.net/pullzone/$ZONE_ID/statistics?dateFrom=2026-05-08&dateTo=2026-05-15" \
-H "AccessKey: $BUNNY_KEY" \
| jq '.CacheHitRate, .OriginTrafficBytes'
For Fastly, you run fastly stats realtime --service-id $SVC or query the historical stats API. The shape of the data is the same; the surface is different.
To audit cache-key composition cross-vendor, send the same request twice with different cookies and verify the second response is not poisoned by the first:
# request 1 — anonymous
curl -sI https://example.com/cart/ -o /dev/null -w "%{http_code} cf=%header{cf-cache-status}\n"
# request 2 — with a fake logged-in cookie
curl -sI https://example.com/cart/ \
-H "Cookie: wordpress_logged_in_abc=1" \
-o /dev/null -w "%{http_code} cf=%header{cf-cache-status}\n"
If both return HIT from the same cached object, your edge is poisoning logged-in users with anonymous responses. This is a P1 incident waiting to happen on WooCommerce sites — cart contents leak across users.
The fix
The vendor choice should follow the rule complexity, not the brand. Below is a decision matrix we apply on first engagement.
Use Cloudflare if: the rules fit in five Page Rules plus one or two Workers, you want the integrated WAF and bot management in the same surface, and the team is JavaScript-fluent. APO (Automatic Platform Optimization) is genuinely useful for a vanilla WordPress site with no logged-in surface — it caches HTML with cookie-aware bypass without any rule writing.
// Cloudflare Worker: bypass cache for logged-in WordPress users + WC carts
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
const cookies = request.headers.get('Cookie') || ''
const isLoggedIn = /wordpress_logged_in_|wp-postpass_|woocommerce_items_in_cart|woocommerce_cart_hash/.test(cookies)
const init = {
cf: {
cacheTtl: isLoggedIn ? 0 : 300,
cacheEverything: !isLoggedIn,
cacheKey: isLoggedIn
? undefined
: `${request.url}|device=${deviceClass(request)}`
}
}
return fetch(request, init)
}
function deviceClass(req) {
const ua = req.headers.get('User-Agent') || ''
if (/Mobi|Android|iPhone/i.test(ua)) return 'mobile'
if (/iPad|Tablet/i.test(ua)) return 'tablet'
return 'desktop'
}
Use BunnyCDN if: bandwidth cost dominates the bill, the rule set is mostly declarative (cache-control overrides, pattern-based bypass, country routing), and you do not need ESI. The Edge Rule engine handles 80% of WordPress patterns without scripting:
# BunnyCDN Edge Rule (declarative — set in UI or via API)
Trigger: RequestHeaders.Cookie matches "wordpress_logged_in_"
Action: Set Cache Time = 0
Bypass Cache = true
Trigger: QueryString matches "utm_|fbclid|gclid"
Action: Cache Key Override = strip matching params
Trigger: URL matches "*.jpg|*.png|*.webp|*.avif"
Action: Set Cache Time = 31536000
Browser Cache Time = 86400
Use Fastly if: you need ESI, complex VCL logic, multi-origin failover with body-content health checks, or you’re running a publishing operation where edge personalization (cohort-based content selection at the edge) is core to the product. The cost is operational — VCL must be tested, deployed via the API, and rolled back like application code:
# Fastly VCL — WordPress edge bypass + ESI fragment caching
sub vcl_recv {
# bypass logged-in users
if (req.http.Cookie ~ "wordpress_logged_in_|wp-postpass_|woocommerce_(items_in_cart|cart_hash)") {
return(pass);
}
# strip marketing query params from cache key, keep them for origin
set req.http.X-Original-QS = req.url.qs;
set req.url = querystring.regfilter(req.url, "^(utm_|fbclid|gclid|mc_eid|_ga)");
# device fragmentation for cache key (mobile-specific theme variant)
if (req.http.User-Agent ~ "(?i)Mobi|Android|iPhone") {
set req.http.X-Device = "mobile";
} else {
set req.http.X-Device = "desktop";
}
return(lookup);
}
sub vcl_fetch {
# enable ESI processing on responses that opt in via header
if (beresp.http.X-ESI == "1") {
esi;
}
# stale-while-revalidate window
set beresp.stale_while_revalidate = 30s;
set beresp.stale_if_error = 86400s;
}
For multi-CDN resilience, the safest pattern is a single primary and a warm secondary with health-checked failover at the DNS layer (NS1, Cloudflare LB, or Route 53 with health checks). Active-active multi-CDN with traffic splitting is a different problem — it requires per-vendor cache invalidation discipline that most WordPress operations do not have headroom for.
Before flipping a production zone to a new edge, run a 48-hour parallel test on a cdn-stage.example.com hostname with full traffic mirroring. The first thing to break is always cookie handling for the checkout funnel, and you want to find it on stage, not in production.
Stack Harbor configures and operates CDN edges as part of the enterprise WordPress operations operating model — including cache-key audits, edge rule reviews, and multi-CDN failover. If you’re sizing the CDN choice for a new site or a re-architecture, we can scope the rule set and run the parallel test before cutover.