API reference

Page cache

Public pages are cached in memory after the first render and then served directly – without database access or template rendering.

  • Key: website + path + query string (/blog?seite=2 is a separate entry; identical paths of different websites are kept apart).
  • Expiry: entries expire at midnight (server time) at the latest, so that today in templates is correct.
  • Invalidation: every successful change via the API (pages, snippets, CSS/JS, collections, entries, files, REST sources, workflows – including changes a workflow makes via the API) and every completed import clears the entire cache. Read-only calls such as the preview, POST /markdown or POST /sources/test leave it untouched.
  • REST sources: if a page uses data() with a REST source, it stays in the cache at most as long as that source’s cache_ttl. With cache_ttl: 0, it is not cached.
  • Exceptions: pages with no_cache: true, admin previews (?preview=1), 404 and error pages are never cached.
  • Size: limited via the startup option -cache-mb (default 128, 0 = off); when exceeded, the least recently used pages are evicted.
  • HTTP: responses carry ETag and Cache-Control: no-cache – browsers revalidate with If-None-Match and receive 304 Not Modified for unchanged pages. gzip is precomputed once per entry. The X-Cache header shows HIT, MISS or BYPASS.

GET /cache 🔑

{ "enabled": true, "entries": 42, "bytes": 3145728, "max_bytes": 134217728, "hits": 1290, "misses": 57 }

DELETE /cache ✏️

Clears the cache manually. 204.