revalidate (route segment config)
Sets the default ISR revalidation interval for a route segment.
Syntax
export const revalidate = false | 0 | number Returns
number | false — Seconds before the cache is considered stale.
Examples
// Revalidate the whole page at most every hour (ISR)
export const revalidate = 3600
export default async function Page() {
const posts = await getPosts()
return <PostList posts={posts} />
}
// Disable caching for this segment
export const revalidate = 0
Notes
`false` (default) caches indefinitely until manually revalidated; a
number sets a time-based revalidation in seconds (Incremental Static
Regeneration); `0` opts out of caching entirely. A `fetch`'s own
`next.revalidate` can be shorter but not longer than the segment
value. Exported from `layout.js`/`page.js`/`route.js`.