Skip to solution
mediumFrontend

What is the route segment config in Next.js (dynamic, revalidate, runtime)?

1.2k views
01

Understand the problem

Per-segment exports that control rendering and caching.

nextjssegment-configrevalidateruntime
02

Attempt it yourself

Sketch your approach before reading the solution — that's what interviews test.

Nudge consolestandby

Stuck? Beam a request up — the console returns a conceptual nudge that guides your logic without spoiling the implementation.

03

Study the solution

You export consts from a layout/page/route to control behavior: dynamic ('auto'|'force-dynamic'|'force-static'), revalidate (ISR interval), runtime ('nodejs'|'edge'), fetchCache, and dynamicParams. They override the defaults for that segment.

Solution ready — 2 min read

Classified // press E to declassify

04

Read the code

Segment config exports
// app/feed/page.tsx
export const dynamic = 'force-static';   // always prerender
export const revalidate = 3600;          // ISR: refresh hourly
export const runtime = 'edge';           // run on the Edge runtime

export default async function Feed() { /* ... */ }
05

Join the discussion

Discussion (0)

Sign in to join the discussion.

No responses yet. Be the first to share what you think.

Transmission complete // awaiting log

KEEP THE
STREAK ALIVE.

Dossier 12 of 95 decoded in the Next.js track. One more won't hurt.

Back to track