DocsChoose

ISR (stale-while-revalidate)

Set revalidate = N in the frontmatter of a .nexy page to cache it with a stale-while-revalidate policy.

src/routes/blog/index.nexy
---
revalidate = 60
---
<h1>Rendered at most once per minute</h1>

What Nexy does

  • Sends Cache-Control: public, s-maxage={revalidate}, stale-while-revalidate={revalidate} on cached responses.
  • Caches in-process (an in-memory cache) per path.
  • Applies the policy only when revalidate is a positive integer on the module.

Next steps

  • SSR: how pages are rendered before caching
  • Pages: layouts and dynamic segments
  • .nexy files: frontmatter reference

Edit on GitHub

Enter opens the result, Esc closes.