← Back to overview

SWR — Stale-While-Revalidate

Uses server-level caching with a 30-second freshness window. Similar to ISR but uses standard Cache-Control headers instead of Netlify's durable cache. The cached version is served instantly while a fresh render happens in the background after the TTL expires.

StrategySWR
Rendered at

2026-03-24T17:44:32.580Z

If this timestamp stays the same across reloads, the page is being served from cache.

Expected Response Headers

Cache-Status: "Netlify Edge"; hit (or miss on first request)
Cache-Control: public, s-maxage=30, stale-while-revalidate=31536000

How it works

  • Nuxt routeRules: { swr: 30 } sets standard cache headers
  • First request: miss → page is server-rendered and cached
  • Within 30s: hit → cached response served, timestamp stays frozen
  • After 30s: stale → cached version served, background revalidation triggered
  • Unlike ISR, this does not use Netlify's durable cache flag

Use cases

  • Dashboards, feeds, or listings that update frequently
  • Pages where freshness matters more than ISR but instant response is still important
  • When you want standard HTTP caching semantics without Netlify-specific headers