Connecting BunnyCDN to ForgeCache
ForgeCache 2.1.18 added a real BunnyCDN integration: your bunny.net Account API key plus the Pull Zone ID of the zone in front of your WordPress site, pasted once. ForgeCache then automatically purges your BunnyCDN edge cache every time WordPress clears its own cache — post updates, theme switches, manual purges, all of it. This walkthrough is the complete first-time setup: find your API key, find your Pull Zone ID, paste both, test, enable auto-purge.
The native BunnyCDN API integration ships in ForgeCache 2.1.18 (released 2026-05-29). Earlier versions had a generic CDN URL rewriter only — no API integration, no auto-purge. If you’re on an older version, update from WP Admin → Plugins first.
This walkthrough assumes you’ve already set up a BunnyCDN pull zone pointing at your WordPress site (with an origin URL like https://example.com). If you haven’t, do that first in the BunnyCDN dashboard — it’s outside ForgeCache’s scope. Once your pull zone exists, come back here to wire it up to ForgeCache.
What This Walkthrough Covers
Five short steps, about 5–10 minutes start to finish:
- Find your Account API key at dash.bunny.net.
- Find your Pull Zone ID (the numeric ID, not the hostname).
- Paste both into ForgeCache at Settings → Advanced → CDN Integration.
- Click Test connection to confirm both credentials work.
- Enable Auto-Purge so ForgeCache fires a BunnyCDN purge on every cache-clear event.
Unlike Cloudflare’s scoped tokens, BunnyCDN currently uses one Account API key that has full access to everything on your bunny.net account — all pull zones, billing, DNS, storage zones, the lot. ForgeCache only uses it to test the pull zone and fire purges, but the key itself is broad. Keep it as protected as you would your bunny.net account password, and rotate it (regenerate at dash.bunny.net) if you ever suspect it’s leaked.
Step 1 — Find Your Account API Key
The Account API key lives on your bunny.net account profile, not on any specific zone. Sign in to bunny.net first, then follow the steps below. (BunnyCDN occasionally redesigns this surface — if your dashboard looks different, the key is always under your account settings.)
Sign in at dash.bunny.net
Go to dash.bunny.net and log in to your bunny.net account.
Open Account → API
From the main dashboard, navigate to Account (top navigation or sidebar, depending on screen size) and then to the API tab/section. The exact path varies slightly with bunny.net redesigns — if you’re unsure, your direct URL is roughly dash.bunny.net/account/api.
Copy your Account API key
The page shows your API key (often masked, with a Show / Copy button). Click Copy. Unlike Cloudflare, BunnyCDN does NOT hide the key after first creation — you can come back and re-copy it anytime. But the regenerate button replaces it (and breaks any existing integrations using the old value), so don’t click that unless you mean to rotate.
Anyone with this key can purge zones, change billing, transfer DNS, delete storage zones — the lot. Don’t paste it into Slack, email, or anywhere it might be logged. The only place it should ever go is the ForgeCache settings field in step 3.
Step 2 — Find Your Pull Zone ID
The Pull Zone ID is a numeric identifier (not the example.b-cdn.net hostname). It’s in the URL of your pull zone’s settings page in the BunnyCDN dashboard.
Open your pull zone list
From dash.bunny.net, click into the Delivery section (or whatever bunny.net currently labels the CDN pull-zone area) and you should see a list of your pull zones.
Click into the pull zone in front of your WordPress site
The one with an Origin URL matching your site, e.g. https://example.com. Clicking it takes you to the zone’s settings or overview page.
Read the Pull Zone ID from the URL
Look at your browser’s address bar. The URL will be something like:
https://dash.bunny.net/cdn/123456/
The 123456 in that URL is your Pull Zone ID. Copy that number. It will not be a hostname — only digits.
BunnyCDN gives you two identifiers: the hostname like example.b-cdn.net (used by visitors / your CDN rewriter), and the numeric ID like 123456 (used by the API for purges). ForgeCache needs the numeric ID. If you paste the hostname by mistake, Test connection in step 4 returns a 404 — clear feedback you’ve got the wrong value.
Step 3 — Paste Both Into ForgeCache
You’ve got two values: the Account API key (copied in step 1) and the Pull Zone ID (copied in step 2). Now into WordPress.
Open ForgeCache → Settings → Advanced
In WP Admin, go to ForgeCache → Settings and click the Advanced tab. The first section is CDN Integration.
Enable CDN Integration and choose BunnyCDN
Tick Enable CDN integration, then under Provider choose BunnyCDN. A credential panel appears below with two fields: API Key and Pull Zone ID.
Paste both values
Paste your Account API key into the API Key field and your numeric Pull Zone ID into the Pull Zone ID field. Both values save to the WordPress options table. The API Key field is rendered as a password input so the browser masks it on screen, but treat the saved value the same as any other credential — only WordPress admins should have access to this settings page.
Click Save Changes
Hit Save Changes at the bottom of the page. ForgeCache stores the credentials. Don’t skip this — the Test connection button in the next step reads from saved settings.
Step 4 — Test the Connection
After saving, the Test connection button under the credential fields makes a tiny GET request to BunnyCDN’s pull-zone endpoint to confirm both your key and Pull Zone ID are valid.
Click Test connection
A status message appears next to the button. The expected result is a green “Connection to BunnyCDN succeeded.”. If you see that, you’re done with setup — jump to step 5 to enable auto-purge.
If Test connection fails — what each message means
| ForgeCache message | What it means | Fix |
|---|---|---|
| “BunnyCDN API key is empty.” | You haven’t pasted a key yet, or you cleared the field by mistake. | Re-paste the API key from step 1 and click Save Changes before testing again. |
| “BunnyCDN Pull Zone ID is empty.” | API key is present but the Pull Zone ID field is blank. | Re-paste the numeric Pull Zone ID from step 2, save, retry. |
| “BunnyCDN rejected the API key. Generate a fresh key at dash.bunny.net → Account → API.” | Key reached bunny.net and was rejected with 401 — the key is wrong, regenerated, or was never valid. | Most often a copy/paste truncation — re-copy the key from the bunny.net API page. If a clean re-paste still fails, click Regenerate in bunny.net to issue a fresh key, copy that, and paste it into ForgeCache. |
| “BunnyCDN returned 404 — Pull Zone ID doesn’t exist or the API key doesn’t have access to it.” | Key is valid but bunny.net can’t find this Pull Zone ID under your account. | You probably pasted the hostname (example.b-cdn.net) instead of the numeric ID — recheck step 2. Or you’re signed in to a different bunny.net account from the one that owns the pull zone. |
| “BunnyCDN returned a successful HTTP response but the body was unexpected. Verify the Pull Zone ID is correct.” | Edge case — the API responded with a 2xx but the body didn’t look like a pull zone object. Rare in normal use. | Double-check that the value in the Pull Zone ID field is purely numeric and matches the ID in your bunny.net dashboard URL. |
| “BunnyCDN returned HTTP NNN.” | Anything else — usually a network error, bunny.net API outage, or your host blocking outbound HTTPS to api.bunny.net. |
If the code is 5xx, retry in a few minutes. If your host blocks outbound HTTPS to api.bunny.net, ask them to allow it. |
Step 5 — Enable Auto-Purge
Auto-purge is what makes the BunnyCDN integration actually useful in daily life. When enabled, ForgeCache fires a BunnyCDN purge automatically every time WordPress clears its own cache — so your edge cache always reflects the latest version of your content.
Tick “Auto-purge CDN cache when ForgeCache clears its own”
It’s the checkbox directly below the credential panel. Tick it and click Save Changes.
Understand what auto-purge does
From this point forward, ForgeCache calls BunnyCDN’s purge API whenever:
- You publish or update a post / page — ForgeCache purges that post’s URL plus your homepage URL via BunnyCDN’s per-URL endpoint (two API requests).
- You click Clear All Cache in ForgeCache — ForgeCache purges the entire pull zone in one API request.
- You switch themes — ForgeCache purges the entire pull zone.
- You manually click the Purge CDN cache now button in ForgeCache’s Advanced tab — ForgeCache purges the entire pull zone.
All per-URL purges are deduplicated within each request — if a bulk action clears 50 posts at once, ForgeCache batches the unique URLs so BunnyCDN sees one round of purges, not 50 stacked sequentially.
Unlike Cloudflare’s 1,000-purges-per-zone-per-24h limit, BunnyCDN doesn’t publish a specific number. ForgeCache keeps auto-purge conservative (post URL + homepage on save) so you’re nowhere near anything practical. If you’re ever throttled, you’d see “BunnyCDN returned HTTP 429” in the test or auto-purge logs — that’s the signal to slow down or contact bunny.net support.
Verify the Integration Is Working
Two quick ways to confirm everything is wired up:
Method 1: Manual purge button
In ForgeCache → Settings → Advanced → CDN Integration, click the Purge CDN cache now button. You should see a green “BunnyCDN cache purged.” response. That confirms ForgeCache can authenticate with bunny.net and successfully invalidate the entire pull zone on demand.
Method 2: Edit a post + watch the change land
Open one of your published posts in the WordPress editor, make a tiny change (add a space, undo, save), and click Update. ForgeCache will fire a BunnyCDN purge for that post’s URL plus your homepage automatically. Open your site in an incognito window and load the post — the page should reflect your latest content immediately because the edge cache has been invalidated.
If you’re looking at the post in the same browser that saved it, your browser’s own HTTP cache may serve the previous page back to you even after BunnyCDN purges. Test in an incognito window (or a different browser) to bypass your local browser cache and confirm BunnyCDN actually re-fetched from origin.
Day-to-Day — What to Expect
After the initial setup, you mostly don’t touch this. ForgeCache handles cache invalidation automatically. The only times you’ll come back to Settings → Advanced → CDN Integration are:
- Rotating the API key — if you suspect the key leaked or want to rotate on schedule, click Regenerate in bunny.net (Account → API), copy the new value, paste into ForgeCache, save. The old key stops working the moment you regenerate.
- Switching pull zones — if you replace your bunny.net pull zone (new origin URL, different config), update the Pull Zone ID in ForgeCache to match the new one.
- Triggering a full-zone purge manually — if you’ve made a sweeping change (CSS overhaul, new logo across the site, etc.) and want to nuke the edge cache immediately rather than waiting for natural cache events.
- Diagnosing a cache mismatch — if a visitor reports stale content, the Manual Purge button is your one-click recovery tool.
Still Stuck? Email Priority Support
If Test connection keeps failing after you’ve double-checked the API key and Pull Zone ID, or if auto-purge isn’t firing on cache-clear events:
Email support@royalplugins.com with the diagnostic info below. Priority email support is included with your ForgeCache Pro license — typical response time is within 24 hours.
Information to include in your email
- Your ForgeCache version (from WP Admin → Plugins). 2.1.18+ is required for the BunnyCDN API integration.
- Your WordPress version and PHP version (Tools → Site Health → Info).
- The exact error message from the Test connection button.
- Your hosting provider — some managed hosts block outbound HTTPS to specific endpoints, which can prevent the integration from reaching
api.bunny.net. - Confirmation you used the Account API key, not a Storage Zone password or FTP password — these are sometimes confused with the API key but are different credentials.
- Do NOT include the actual API key in your email. If our team needs to reproduce, we’ll send a secure-form link.
- Connecting Cloudflare to ForgeCache — using Cloudflare instead of BunnyCDN? Different API, same integration shape.
- ForgeCache Documentation — back to the main support page.