Open Javad9s opened 7 months ago
@Javad9s
I don't know what you mean for
cause problems in large scale applications.
but does it mean that files cache (or redis cache) under .next/server/app/params
becomes too big or something else ?
If you mean for file cache (or redis cache) becomes too big , it seems like adding code below
if (isNotFoundError(response.err?)) {
metadata.isNotFound = "NEXT_NOT_FOUND"
}
under
fix the problem (.rsc
.html
.meta
format files are not added under .next/server/app/params
) , but original code here
is intended to be used under environment of pages-router, not app-router, so I don't have confidence.
You can ask any Next.js core team member about this issue I guess.
Link to the code that reproduces this issue
https://github.com/Javad9s/nextjs-dynamic-params-cached-notfound/
To Reproduce
npm run build
,npm start
)notfound()
, also caches the resultnotfound()
, caches a new pagenotfound()
, caches a new pageThis way there is no control over memory and storage usage. Can cause problems in large scale applications.
Current vs. Expected behavior
Current : caches every
notfound()
call Expected : not cache anynotfound()
callProvide environment information
Which area(s) are affected? (Select all that apply)
App Router
Which stage(s) are affected? (Select all that apply)
next start (local)
Additional context
Using
generateStaticParams()
also opts the page into static generation and is equivalent to settingdynamic = 'force-static'
in the context of this issue