Repository navigation
Pages are now cached in front of the site rather than inside it, so a reader is answered from their nearest data centre and the site never runs.
Heads up
- The self-hosted build was broken in 0.9.0 and works again here.
node ./dist/server/entry.mjsexited immediately with a type error, because 0.9.0 moved the theme to a newer Astro without moving the Node server alongside it. If you are on 0.9.0 and self-hosting, this is the reason to upgrade. The Cloudflare deploy was unaffected. - Purging no longer needs Cloudflare API credentials. If you set up
CF_ZONE_IDand a cache-purge token for this theme, nothing reads them any more — delete the worker secrets and revoke the token after you deploy, not before. - Set Browser Cache TTL to "Respect Existing Headers" in Cloudflare, under your domain → Caching → Configuration, if you have not already. The theme states how long a browser may keep each page, and the zone serves whichever value is higher.
Changed
- Pages are cached in front of the site, not inside it. Two tiers sit ahead of the Worker, so a hit is answered at the reader's nearest data centre without the site running at all. On a sister site the same change took a cached page from roughly 400ms to 95ms for a reader on the other side of the world.
- Pages are held for an hour, with ten days of stale-while-revalidate behind it. Publishing still clears the pages an entry appears on, so the longer window bounds only what tags cannot see.
- Cache policy is declared in
routeRulesinastro.config.mjs, next to the routes it applies to, rather than in site code. - The editing toolbar is assembled in the browser on every build, not just the Cloudflare one. A cache that answers before the site runs cannot inject one.
Fixed
- Search results are kept out of the cache properly. They were being offered to it with no lifetime at all, which a cache is free to read as roughly two hours — for the one page built from whatever the reader typed.
Documentation
- The README explains how the theme caches pages, what to set in Cloudflare before deploying, and why a page you have just deployed can still look old.
Full changelog: v0.9.0...v0.10.0