How it works
The build runs in phases: load .env files and config, discover routes, compile client and server code, classify each route as prerenderable or not, prerender, then write .next/ and print the table. The classification is the static-or-dynamic decision; this question is about what it leaves on disk.
For the app in the example (Turbopack), the top level after next build was:
.next/
BUILD_ID C18dHG2iHAO1RznzkYR6U
build-manifest.json prerender-manifest.json routes-manifest.json
required-server-files.json next-server.js.nft.json (trace of the server's own files)
static/ 592 KB chunks/*.js, C18dHG2iHAO1RznzkYR6U/_buildManifest.js
server/ 5.9 MB app/, chunks/, pages/404.html, *-manifest.json
cache/ 24 MB turbopack/
diagnostics/ types/ trace
A prerendered path's .meta file holds what next start replays with the HTML:
"x-nextjs-stale-time": "300",
"x-nextjs-prerender": "1",
"x-next-cache-tags": "_N_T_/layout,_N_T_/isr/layout,_N_T_/isr/page,_N_T_/isr"
"routeCache": { "key": "/route-cache/APP_PAGE/c38585ba…/$/isr", … }
The routeCache.key is new in 16.4. In the 16.4.5 source the files the build wrote are an immutable "build seed". On the first request for a path, the file-system cache copies the seed into .next/server/route-cache/<kind>/<sha256 of the source route>/$<path> and serves from there, and later regenerations write there too. Measured: right after next start, route-cache/ didn't exist; after one GET / it held index.html, .rsc, .meta and three segment files. A page rendered at request time (/blog/d) was written only under route-cache/.
Requests then split three ways:
- Plain files.
/_next/static/* (immutable) and public/ (max-age=0 with an ETag). Nothing renders.
- Cached output.
○/● paths and static GET handlers. The server picks the variant from headers: a document request got isr.html; RSC: 1 was redirected to /isr?_rsc and answered with text/x-component; Chrome 156's <Link> prefetch of /isr made two requests with next-router-segment-prefetch: /_tree and /isr/__PAGE__, matching the .segments/ files. Every cached response says Vary: rsc, next-router-state-tree, next-router-prefetch, next-router-segment-prefetch.
- Rendering.
ƒ routes, ISR regeneration after revalidate, unlisted params, Server Actions (a POST to a page URL, even a static one), route handlers, Proxy and /_next/image.
Only the first group is free of Node.js. That is why a CDN in front can take groups 1 and 2 if it respects Cache-Control and the Vary list, while group 3 always reaches next start.
Edge cases
- The legend lists only symbols in use. The cache-components build above printed
○ and ◐ and no ƒ line, because no route was fully dynamic.
◐ routes get files too: ppr.html, ppr.meta and ppr.segments/ hold the shell, and only the holes render per request (the Partial Prerendering question covers the streaming).
- Route handlers.
ƒ /api/dyn has only route.js; ○ /api/static (dynamic = 'force-static') has static.body and static.meta and was answered with x-nextjs-cache: HIT without running.
- A rebuild wipes runtime output. After a second
next build, .next/server/route-cache/ was gone, so pages generated at runtime are re-rendered on demand.
Real-world scenario
A team builds an image with output: 'standalone', copies only .next/standalone and starts node server.js. HTML loads, hydration never happens: every /_next/static/chunks/*.js is a 404. The output docs say the minimal server leaves those folders out because a CDN should serve them. The fix is either to upload .next/static to the CDN under /_next/static (or set assetPrefix), or run cp -r public .next/standalone/ && cp -r .next/static .next/standalone/.next/ in the image build. After the copy, server.js served both (200).
Trade-offs
Prerendering moves work from request time to build time and turns pages into files with long s-maxage, but the files are only half the story: RSC variants, segment prefetches and revalidation logic live in the server. next start keeps one process in charge of all of it with zero configuration, at the cost that its caches are per process and per disk. Standalone trims the deployment to what tracing found (outputFileTracingIncludes covers what it misses) without changing what runs.