export const dynamic
The route segment option that overrides automatic static or dynamic detection, with values such as force-dynamic and force-static.
In more detail
'auto' is the default. 'force-dynamic' renders on every request; 'force-static' renders once and makes cookies, headers and searchParams return empty values; 'error' fails the build if anything dynamic is used.
Related terms
- route segment config — Constants exported from a page, layout or route file, such as dynamic, revalidate or runtime, that change how that segment is rendered and cached.
- dynamic rendering — Rendering a route fresh on the server for each request, so it can show personalised or constantly changing data.
- static rendering — Rendering a page to HTML once, at build time or on a schedule, and serving that same result to every visitor.
Taught in
- Full Route Cache: Static Rendering & Segment Config — Next.js 15 & Modern App Router Architecture