Skip to content

Caching ​

The router caches hot reads in process so repeated requests avoid re-reading static files. Cache is scoped to a single instance (no shared external store).

Layers ​

LayerBehavior
CacheKeyed by static path; default 512 entries / 256 MB
TTLDefault 300s for payloads, 60s for negative (404) entries
Request coalescingConcurrent misses for the same key share one load
Version pollEvery 10 minutes, reads version.json; if export_date changes, the cache is cleared

Response headers ​

  • ETag — weak FNV-1a of the response body (stable across processes)
  • If-None-Match — returns 304 Not Modified on match
  • X-Cache: HIT|MISS
  • Cache-Control: public, max-age=… (+ s-maxage) on JSON routes; /health is private, no-store
  • Vary: origin, accept-encoding

Configuration (env) ​

VariableDefaultMeaning
CACHE_MAX_ENTRIES512max cached entries
CACHE_MAX_BYTES268435456approx memory cap
CACHE_TTL_MS300000positive TTL
CACHE_NEGATIVE_TTL_MS60000404 TTL
VERSION_POLL_MS600000export version poll interval

Multi-instance deployments keep independent in-process caches and converge via TTL + version polling.

Unofficial. Data owned and maintained by the World Cube Association (worldcubeassociation.org/export/results).