ISR cache
bext caches the rendered HTML per [[route_rules]] entry.
Refresh quickly and you see the same timestamp; wait past
ttl_ms and the next request re-renders. The render
counter below is bumped server-side on every cache MISS — it lives
in the cache layer's L1/L2 store, so it survives V8 isolate churn.
Response carries x-bext-cache: hit | stale | miss and x-bext-render-count: N.
Output
rendered at 2026-05-03T09:06:08.739Z
render # 1
Refresh this page rapidly — the timestamp stays the same. After 60s the next refresh triggers a fresh render and the counter bumps.
Source
// bext.config.toml
[[route_rules]]
pattern = "/**"
render = "isr"
ttl_ms = 60000 // ← cache for 60s
swr_ms = 30000 // ← serve stale for another 30s while revalidating
// page.tsx — every render stamps the current time. Under ISR the
// HTML is cached for `ttl_ms`; refresh inside the window returns the
// same HTML (same timestamp). The `1` token is
// substituted server-side with a per-route counter that bumps on
// every cache MISS — so it tells you how many fresh renders this
// route has done over its lifetime, regardless of V8 isolate churn.
export default function Page() {
const stamp = new Date().toISOString();
return (
<p>
rendered at {stamp} — render #
<Raw html="1" />
</p>
);
}