Skip to content

Troubleshooting ​

Start with the X-Speedy header. Open the page in a private window, or use curl:

bash
curl -sI https://example.com/news | grep -i x-speedy

A page is never cached ​

The header says why, after SKIP:

SKIP …WhyWhat to do
logged inYou’re logged in to CraftTest in a private window
cartThe visitor has a Commerce cartExpected. Set skipWhenCart to false if your pages show nothing from the cart
query stringThe URL has ?something=Expected, as query strings usually change the page. Tracking parameters like utm_source are ignored
sessionThe visitor has something in their session, such as a form step or a flash messageExpected. It clears once the session is empty. See What isn’t cached
ajaxAn htmx, Unpoly or X-Requested-With requestExpected
cookieThe visitor has a cookie listed in skipCookiesExpected
varyThe page sends Vary with something other than Accept-EncodingRemove the header if the page is the same for everyone
unknown hostThe Host header isn’t one of your sites’ domainsCheck the site’s base URL
never cacheThe URL matches Never cacheCheck the patterns in the settings
sets a cookieThe page sets a cookie, so it may be personalFind what sets it, or move it to a page that isn’t cached
privateThe template or a plugin sent Cache-Control: private or no-storeRemove it if the page isn’t personal
templateThe template called craft.speedy.skip()Expected
status 404Only 200 pages are cachedExpected
previewLive preview or a share linkExpected
disabledCaching is offCheck enabled in the settings or config/speedy.php

A change doesn’t show ​

  • Was it a draft? Drafts and autosaves never clear pages. Apply or publish the draft.
  • Is the queue running? Clearing and rebuilding run in Craft’s queue. Check Utilities → Queue Manager, and make sure the queue runs on your server (Cron jobs).
  • Was it rebuilt? Cleared pages keep their old copy until the new one is built, usually a few seconds. Utilities → Speedy Cache → Recent clears shows each clear and its pages.
  • Does the content come from outside Craft? Speedy can’t see changes in APIs or feeds. Give those pages a time limit (Live data).
  • Is it the CDN? If the page is right on your server but old at the CDN, check the CDN result on the utility page, and use Test Cloudflare or Test CloudFront.

To clear something straight away, use Clear URL or Clear all pages on the utility page, or php craft speedy/clear.

Forms say “Bad request” on cached pages ​

The CSRF token on cached pages is replaced by a fresh one as the page loads. If your site blocks the request to actions/speedy/csrf, or a script on the page runs before the token is filled in, submissions fail. Check the browser console for errors, and see Forms and CSRF.

The server check says pages are served by PHP ​

The rules aren’t being used yet:

  • Check you added them to the right site’s config, and reloaded the web server.
  • Check cachePath is inside the web root (the default, @webroot/speedy, is).
  • Print the rules again with php craft speedy/server-rules if you changed cachePath.

The cache folder is large ​

Pages are plain HTML, typically 20–100 KB each. Utilities → Speedy Cache shows the total. Clear everything any time; pages are rebuilt as they’re visited.

Logs ​

  • Recent clears on the utility page and in php craft speedy/status: what was cleared, why, and which pages, plus pages that couldn’t be rebuilt and CDN errors. It keeps the last 1,000 entries.
  • storage/logs/speedy.log: warnings and errors, such as a page that couldn’t be saved, a CDN error or a sitemap that couldn’t be read. With devMode on, it also lists each page that couldn’t be rebuilt and why. Craft starts a new file each day and keeps five.

Speedy never logs each visit, so the logs stay small however busy the site is.

Images load slowly on cached pages ​

If image transforms are generated on first view, a cached page can keep links that create them. Set generateTransformsBeforePageLoad to true in config/general.php, so cached pages always link to finished images.