Dev Tools · 2h ago
Fix Next.js Sitemap Staleness with One Line of ISR
A common bug in Next.js sitemaps causes them to serve outdated content due to a two-layer caching issue. Adding route-level ISR with `export const revalidate = 3600` forces the sitemap to re-render hourly, fixing the problem. This one-line fix eliminates the need for inner cache wrappers and ensures crawlers always see fresh data.
Meridian48 take
The fix is simple, but the underlying cache-coherence bug highlights how Next.js's caching layers can trip up developers who assume revalidateTag covers all bases.
nextjssitemap-caching