SWR or ISR for Periodically Updated Nuxt 3 Routes?
0 reputation · 01 May 2025, 10:14 UTC
Goal
Select a Nuxt 3 routeRules caching strategy for dynamic pages whose content changes on a fixed schedule, balancing origin load, SEO, and acceptable staleness.
Constraint
Nuxt 3.8+ lists experimental swr with a default TTL of 3600 seconds and isr requiring an explicit ttl. Both depend on a Nitro-compatible edge platform; self-hosted Node.js deployments may fall back to per-request SSR, removing CDN benefits. SWR serves cached HTML immediately while revalidating in the background, risking stale content. ISR serves cached HTML until TTL expiry, then triggers regeneration, which can spike origin traffic on popular routes. Client-side useFetch or useAsyncData navigation does not automatically inherit routeRules and may bypass the CDN cache.
Open questions
- For a high-traffic route updated hourly, does SWR reduce origin load more reliably than ISR where native ISR is unavailable?
- When TTL expires on a popular ISR route, is regeneration blocking or background, and what does that mean for SEO crawlers?
- Can SWR or ISR caching be used for authenticated pages without a custom cache-key strategy?