Dev Explains Why His 404 Page Returns 200 Status in Next.js 16
A developer running a Dutch certification practice-exam site found that unknown exam form URLs displayed a not-found page while still returning a 200 OK status, which search engines call a soft 404. The cause is partial prerendering in Next.js 16: the response headers are sent before notFound() runs inside a streamed Suspense boundary. He evaluated several fixes, including generateStaticParams, dynamicParams = false, full static rendering, and an edge proxy, but rejected them because the page depends on session cookies and database checks. An edge proxy would have worked but would add risk to the app's most sensitive request path. He chose to keep the current behavior, reasoning that the exam pages are noindex, the /examen/ path is blocked in robots.txt, and no internal links point to nonexistent forms.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in