Frequently changing data
A dashboard must show data that changes between requests.
Next.js 16+ · Const
export const dynamic = 'force-dynamic' opts an App Router route into request-time rendering. Use it when the route must reflect current or personalized data.
The dynamic segment configuration lets an App Router route explicitly select dynamic rendering. Setting it to force-dynamic makes the route render on every request instead of being prerendered, which is useful when its output must reflect request-time or frequently changing data.
export const dynamic = 'force-dynamic'dynamic at the route segment level and set it to force-dynamic to require dynamic rendering.export const dynamic = 'force-dynamic'
export default async function Page() {
const res = await fetch('https://api.example.com/products', {
cache: 'no-store',
})
const products = await res.json()
return <pre>{JSON.stringify(products, null, 2)}</pre>
}This page opts into request-time rendering and fetches fresh data for each request.
A dashboard must show data that changes between requests.
A response depends on cookies, headers, or URL search parameters.
A page combines a stable shell with sections that resolve from live sources.
export const dynamic = 'force-dynamic' do?force-dynamic explicitly opts a route into rendering at request time. This is appropriate when the response depends on current or personalized data rather than a build-time result.
Follow-up: Can a dynamic route contain cached work? Yes. Dynamic and cached behavior can coexist at the component or operation level.
Dynamic rendering generates content on the server for each user when the page is requested. It suits data that changes frequently or depends on information available only at request time.
Follow-up: What is the performance trade-off? The route can be limited by its slowest data fetch, so independent sections should be structured to stream where appropriate.
Next.js can combine static and dynamic content within one response. A page may have a static shell while dynamic sections resolve and stream separately.
Follow-up: Why avoid making an entire route dynamic unnecessarily? Keeping static portions static can improve initial delivery while isolating request-time work to the components that need it.
Dynamic RenderingRoute HandlerscookiesheaderssearchParamsfetchSuspense