Caching
Pages are rendered once and served from a cache, so visitors get them fast.
What it does
Every public page is cached after its first visit. When an editor publishes a change, only the pages it affects are rendered again, on their next request. Saving a draft touches nothing. As a safety net, a cached page that has become old is also rendered again in the background after a set time.
The pages it affects are the page or post itself and every other page that shows it: menus, the breadcrumb trail, the language switcher, the sitemap, links to it in text, and the Blog or News list. Renaming a page or moving it refreshes the pages below it too, including the posts of an index page. A link to a page shows its new address on the first visit after the change, or plain text once the page is unpublished.
Images are cached too. Replacing, cropping or deleting a file in Media refreshes the pages that show it, and so does a change to what the site shows of it, such as its description. The visitor’s browser keeps a copy of each file for up to a week, and asks again only whether it has changed, so the logo doesn’t blink on every page. That is safe because every change to a file gives it a new address, so a changed image is fetched at once. Only a link to the bare file address from another site can keep an old copy for up to a week.
See it in the demo
In the admin, open Cached pages (under Cache) to see every cached URL and whether it is fresh, stale or invalidated. Select some rows and choose Invalidate & refresh to render them again at once. Each page’s edit view also has an Invalidate cache button.
For developers
The time limit is PAGE_REVALIDATE_SECONDS. For content changed outside the admin, such as a script or a deploy, run pnpm cache:invalidate against the running app (exact URLs, --page or --all); pnpm cache:list prints the same list as the admin view. The week for media files is MEDIA_CACHE_MAX_AGE, and the address of every Media file carries a ?v= version made from its update date. See the README sections "Page cache: what refreshes what" (which tag each edit refreshes), "Caching media files", "Invalidating the page cache from a terminal" and "Seeing what’s cached".
One block, every feature page
This strip is a reusable block: written once and placed at the end of every feature page. Edit it under Reusable blocks and all of them change.