A dynamic segment such as [id] has no fixed URL, so next build can't prerender it unless told which values exist. generateStaticParams returns that list ([{ id: '1' }]); it runs once during the build, before the page renders, and is not called again on revalidation. Each listed value becomes a prerendered page (● in the route table). Without the function the route renders per request (ƒ).
Unlisted values depend on the rendering model.
Without Cache Components, dynamicParams decides:
true(default): the first request renders the page, the response is cached, and later requests get the cached copy. That's ISR on demand, the App Router's version ofgetStaticPathswithfallback: 'blocking'.false: an unlisted value returns 404 immediately, without running the page.
Returning [] prerenders nothing at build time but keeps the route ●, so every path is generated on its first visit.
With cacheComponents: true, dynamicParams fails the build ("not compatible with nextConfig.cacheComponents"), and an empty array fails it too: Next.js needs at least one real value to check the route for request-time access. An unlisted value is served the route's App Shell (the prerender with param-dependent parts behind <Suspense> fallbacks), its content streams in, and the completed page is cached for the next visit. To reject unknown values you call notFound() when the data lookup fails.
That last step has an HTTP catch: with Cache Components the shell starts a 200 response before notFound() runs, so the first visit to a bad id gets 200 plus <meta name="robots" content="noindex">; the docs suggest Proxy for a request-time 404.