Speedy Cache
Fast pages for Craft, cleared just right.
Speedy Cache saves your pages as static HTML files and serves them in about a millisecond. When you save an entry, it clears only the pages that show it, rebuilds them in the background and clears them from Cloudflare or CloudFront too. It adds no database tables, and your templates stay as they are.
Features
- Static files, served without PHP. Add the generated nginx or Apache rules and cached pages never touch PHP or the database. Without the rules, pages are still served from the cache by PHP.
- Clears only what changed. Speedy uses Craft’s own cache tags: saving “Summer Sale” clears its page, the News listing and the homepage that show it, and nothing else.
- No database bloat. Pages and what they depend on are kept as files. Nothing is added to your database, however many pages you have.
- Visitors never wait. Changed pages are rebuilt in the background, and the old copy is served until the new one is ready.
- Imports clear once. An import or a resave of thousands of entries queues one clear job, after it finishes, and listings that show every entry are rebuilt once after a run of changes, not after each.
- Drafts don’t clear anything. Autosaves, drafts and revisions never touch live pages.
- Saves that change nothing don’t clear anything. Clicking Save twice leaves the cache alone; Speedy compares each field with what’s stored.
- Stock and prices stay right. Commerce stock changes, pricing rules, and sale prices that start or end on a date clear the product’s pages, right on time.
- Scheduled content. Pages clear when an entry’s post date or expiry date arrives, including the listings it goes live on.
- Keeps working when the queue stops. If Craft’s queue isn’t running, Speedy clears pages straight away and shows an alert, so changes still appear.
- Cloudflare, CloudFront, Fastly, Bunny and Varnish. Most are detected from their headers. Add a token or key and Speedy clears your CDN when pages change, with a Cloudflare zone for each domain on multi-site. CloudFront paths are grouped into wildcards to stay in the 1,000 free paths a month, with a counter on the utility page.
- Safe without CDN keys. CDNs are told not to keep pages Speedy can’t clear, so visitors never see an old page. With keys, the CDN keeps your site up for a day if the server goes down.
- Instant links. Turn it on and a page starts loading as soon as a visitor points at its link, so it opens straight away. Only safe links, and never for logged-in visitors.
- Personal parts on cached pages.
craft.speedy.dynamic()loads a cart count, a greeting or a whole form into a cached page, built for each visitor. - Forms just work. CSRF tokens, and captchas from supported form plugins, are refreshed on cached pages. No template changes.
- Safe by default. Logged-in visitors, Commerce carts, form steps, flash messages and pages that set cookies aren’t cached, and a made-up cookie can never end up in the copy everyone gets.
- Query strings, your way. Query strings aren’t cached unless you list them, such as
pagefor pagination, with a cap per page so the disk can’t fill. Tracking parameters such asutm_sourceare ignored. - Warming. Rebuild your sitemap, or a list of pages, after clearing everything, with the homepage and top pages first.
- See why it cleared. A plain-English log: “Saved entry ‘Summer Sale’ → 3 pages”, with the URLs.
- Find slow templates. The slowest pages, queries that run in a loop (N+1 queries), and queries that clear a page whenever anything changes, each with the template and line and how to fix it. Measured while Speedy rebuilds pages, never on visitors’ requests.
- Query strings, made easy. Speedy shows which parameters keep pages out of the cache, such as
?view=map, and caches or ignores them in one click. - “Why isn’t this page cached?” Enter an address and Speedy opens it as a visitor, then says why, in words, with what to change.
- Images at full speed. Pages cached before their image transforms are made are rebuilt once they are, so images don’t go through PHP.
- Utility page and dashboard widget. Pages cached, recent clears, repeated queries, clear all, one URL or a whole section, warm, a server check and CDN tests. Editors can be allowed to clear pages without the rest.
- Sized for small plans. Set a limit on the disk space cached pages may use.
- Cache everything, or only some. Never cache checkouts and accounts, or only cache the sections you choose.
- API. Clear or rebuild pages over HTTP with a key, from a deploy pipeline or another system.
- Built for developers. An event at every stage, from deciding whether a request is cached to clearing the CDN, plus
craft.speedy.tag()to clear your own pages by name. - Console commands.
speedy/clear,speedy/warm,speedy/expire,speedy/status,speedy/server-rulesandspeedy/migratefor deploys, cron and switching from another page cache.
Two settings to start
Turn it on, and list URLs that should never be cached. Everything else has a sensible default.
// config/speedy.php
return [
'enabled' => '$SPEEDY_ENABLED',
'neverCache' => ['checkout/*', 'account*'],
'warm' => 'sitemap',
];
In templates
Most sites need no changes. For the exceptions:
{# Don’t cache this page #}
{% do craft.speedy.skip() %}
{# Rebuild this page every 10 minutes #}
{% do craft.speedy.ttl(600) %}
Is this page cached?
Every response says what Speedy did:
X-Speedy: HIT
X-Speedy: STATIC
X-Speedy: SKIP logged in
And cached copies end with <!-- Cached by Speedy Cache on … -->. For the reason in words, use Why isn’t this page cached? on the utility page.
Requirements
Craft CMS 5.6 or later and PHP 8.2 or later, tested on both. Serving without PHP needs nginx or Apache rules (generated for you). Several web servers need shared storage for the cache folder.
Standard
Plus $39/year after one year.
To install this plugin, copy the command above to your terminal.
This plugin doesn't have any reviews.












