SSG, fully prerendered

Three cached scopes with cacheLife expiry of an hour or more, and one panel with no data. Nothing here defers to request time, so the route is served as static HTML from the cache.

The probe panel matters most. random.org returns a different integer on every call, so a number that never changes proves the scope is not re-executing.

What to check

Reload this page ten times in a build (pnpm build && pnpm start). Inside the station roll-up’s 5 minute revalidate window, no stamp, probe value or execution id should move.

Then confirm it came out of the build rather than a warm runtime cache: curl -s localhost:3000/ssg | grep -o 'data-exec="[^"]*"' | sort -u twice in a row gives identical output.

Rebuild, and every stamp jumps to the new build time.

Immutable upstream

Static, no data

static

ran at exec vyn3oqage …

The stamp is the moment this module was loaded, which is the build for a prerendered route. Read at module scope rather than during render, because an uncached Date.now() during prerender is a build error under Cache Components.

Markup plus one module-scope constant. Always in the static shell.

Settled FX rates

use cache
cacheLife
max
upstream
236ms

ran at exec g3cye0age …

1 USD · published 2024-01-02

  • CHF0.84931
  • EUR0.91274
  • GBP0.79085
  • JPY142.1

A fixed past date, so the upstream response never changes. That is why cacheLife('max') is safe here.

Station roll-up and cache probe

All stations — one request, one entry

use cache
cacheLife
blog
cacheTag
stations, stations:index
upstream
483ms

ran at exec tztabpage …

  • London16.3°C · 63% · 1026.4hPa
  • Paris16.8°C · 65% · 1025.7hPa
  • Reykjavik9.5°C · 89% · 985.9hPa
  • Tokyo20.6°C · 71% · 1008.3hPa
  • Sydney18.5°C · 56% · 1013.1hPa
  • New York24.2°C · 68% · 1012.6hPa
  • Santiago22.3°C · 44% · 953.5hPa
  • Nairobi18.2°C · 54% · 841.4hPa

Every station in a single upstream call, so this is one cache entry covering many entities and can only be invalidated as a unit. Compare with the per-station entries on /tags.

Cache probe

use cache
cacheLife
max
upstream
239ms

ran at exec 24jr17age …

probe 57,047

random.org returns a different integer on every call. A number that does not change means a cache hit, whatever the timestamp says.