Next documents stable per-route exports: without Cache Components, dynamic and revalidate (previous-model guide); with Cache Components, ensureStatic (v16.4.0+; this port sets ensureStatic = 'shell' in the root layout) plus 'use cache' boundaries (see section 4). This port enables Cache Components, where dynamic, revalidate, fetchCache, and dynamicParams are removed (route segment config).
Code example
With cacheComponents: true, a layout or page exports ensureStatic to say how much of the route must be static. The port sets 'shell' on the root layout, so the App Shell is prerendered and request-specific content streams in behind <Suspense>. 'navigation' would require the whole route to be static.
// app/layout.tsx
import { Suspense } from 'react'
// …
// Every route's App Shell (sidebar, header, Suspense fallbacks) must stay static;
// request-specific content streams in behind Suspense at prefetch/navigation time.
export const ensureStatic = 'shell'
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<Suspense fallback={<HomeLinkFallback />}>
<HomeLink />
</Suspense>
{children}
</body>
</html>
)
}
Source: Next.js: ensureStatic