Appearance
Fastly, Bunny, KeyCDN and Varnish
Besides Cloudflare and CloudFront, Speedy clears Fastly, Bunny, KeyCDN and Varnish. Add their details in Settings → Plugins → Speedy Cache → CDN, ideally as environment variables. Once they’re set, cached pages are sent with Cache-Control: public, s-maxage=…, so the CDN keeps them, and Speedy clears changed pages from it. Test buttons appear on the utility page.

Fastly
- In Fastly, create an API token with purge_select and purge_all scope for your service.
- Copy the service ID from the service’s page.
- Add them to
.envand enter$FASTLY_TOKENand$FASTLY_SERVICE_IDin the settings:bashFASTLY_TOKEN="…" FASTLY_SERVICE_ID="…"
Changed pages are purged by URL; Clear all pages purges the whole service. Speedy notices Fastly from the Fastly-FF header.
Bunny
- In the Bunny dashboard, copy your API key from Account → API.
- Copy the pull zone’s ID from its page.
- Add them to
.envand enter$BUNNY_API_KEYand$BUNNY_PULL_ZONE_IDin the settings.
Changed pages are purged by URL; Clear all pages purges the pull zone.
KeyCDN
- In the KeyCDN dashboard, copy your API key from Account Settings → Authentication.
- Copy the zone’s ID from Zones.
- Add them to
.envand enter$KEYCDN_API_KEYand$KEYCDN_ZONE_IDin the settings. - Enter the zone URL, such as
example-1a2b.kxcdn.com. Leave it blank if the zone has Cache Key Host turned on, so KeyCDN keeps pages by your own domain.
Changed pages are purged by URL, in batches, as KeyCDN takes one purge a second; Clear all pages purges the zone. Speedy notices KeyCDN from the X-Pull header it sends with each request.
Varnish
List your Varnish servers, one per line, such as http://127.0.0.1:6081. Speedy sends each one a PURGE request for every changed page, with the page’s host, and a BAN request to clear everything.
Varnish must allow those requests from your web server. Add this to your VCL:
vcl
acl purge {
"127.0.0.1";
# your web servers
}
sub vcl_recv {
if (req.method == "PURGE") {
if (!client.ip ~ purge) { return (synth(405, "Not allowed")); }
return (purge);
}
if (req.method == "BAN") {
if (!client.ip ~ purge) { return (synth(405, "Not allowed")); }
ban("req.http.host == " + req.http.host + " && req.url ~ " + req.http.X-Ban-Url);
return (synth(200, "Banned"));
}
}Test Varnish on the utility page checks that PURGE is allowed.
Another CDN
Other plugins and modules can add a CDN. See Events.
Netlify and Vercel
Craft runs on a PHP server, so Netlify and Vercel can’t host it or sit in front of it as a CDN; they’re for static and JavaScript sites. Speedy caches pages on your Craft server, and any of the CDNs above can sit in front of it.