Link with prefetch={false}
is not respected in the latest canary
#48780
Labels
area: app
App directory (appDir: true)
bug
Issue was opened via the bug report template.
Navigation
Related to Next.js linking (e.g., <Link>) and navigation.
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Routing (next/router, next/navigation, next/link)
Link to the code that reproduces this issue
https://stackblitz.com/github/Fredkiss3/next-dynamic-test-updated?file=app%2Flayout.tsx
To Reproduce
/dynamic
(either by clicking on the link or by clicking on the button)/dynamic
, this time you won't see anything printed on the console/dynamic
you will see the current time logged in the terminalDescribe the Bug
There were some improvements about route segment caching on client navigations introduced by this PR #48383 , but with that now
<Link prefetch={false}>
is not respected anymore even though it is said that a link without prefetching should not be cached at all and always refetched between navigations, this is a bug because there are some cases where we want always fresh data like auth gated routes with JWT sessions limited in time, and more.Expected Behavior
When using a Link with
prefetch={false}
the page should not be cached at all and all subsequent navigations should refetch and call the server.Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: