-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Open
Labels
Error HandlingRelated to handling errors (e.g., error.tsx, global-error.tsx).Related to handling errors (e.g., error.tsx, global-error.tsx).HeadersRelated to the async headers() function.Related to the async headers() function.
Description
Link to the code that reproduces this issue
https://github.com/yoohahn/nextjs-notFound-cached
To Reproduce
- yarn preview
- Go to http://localhost:3000/en/404
Check the Cache Control header.
Current vs. Expected behavior
The route that matches the condition for our notFound()
to be call is cached. It is expected that a 404 is not cached and gets the Cache Control value Cache-Control private, no-cache, no-store, max-age=0, must-revalidate
, as done when going to http://localhost:3000/en/nope
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #202412060638~1748542656~22.04~663e4dc SMP PREEMPT_DYNAMIC Thu M
Available memory (MB): 31765
Available CPU cores: 20
Binaries:
Node: 24.0.1
npm: 11.3.0
Yarn: 4.6.0
pnpm: N/A
Relevant Packages:
next: 15.3.4
eslint-config-next: N/A
react: 19.1.0
react-dom: 19.1.0
typescript: 5.7.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Error Handling, Headers
Which stage(s) are affected? (Select all that apply)
Other (Deployed), Vercel (Deployed), next start (local)
Additional context
I found this issue that looks similar;
#75023
and should have been fixed in github.com//pull/75009
But that pr is in 15.3.4 that I am running. I have also tested next@canary
but the same there.
Metadata
Metadata
Assignees
Labels
Error HandlingRelated to handling errors (e.g., error.tsx, global-error.tsx).Related to handling errors (e.g., error.tsx, global-error.tsx).HeadersRelated to the async headers() function.Related to the async headers() function.