Next.js Discord

Discord Forum

Use <Link> with next/navigation, but disable cache on specific Page

Unanswered
! VINKE posted this in #help-forum
Open in Discord
Hello, I am using <Link> from next/navigation in my project, but I want to know if it is possible to disable cache on a specific page.
Every time the user navigates to that specific page/route, SSR reloading should be mandatory.
I tried using export const revalidate = 0; but it doesn't work on my project (maybe I'm using something else that's blocking it, or I'm not using it the right way 😂)
I try to see in gtp discord part with out result : https://discord.com/channels/752553802359505017/1304219731993301194

9 Replies

not much can be done though. nextjs does not allow you to opt part of the app out of the router cache while maintaining the cache in other parts
@joulev not much can be done though. nextjs does not allow you to opt part of the app out of the router cache while maintaining the cache in other parts
yeah make sense, and another question, if i use router.refresh() from next/navigation, that mean i refresh everything ?
yes
@joulev yes
ok so if i create an inventory app with <Link> and want to use cache for better experience
When the user adds items to their inventory, go to another page and come back, how can I ensure that the item is always displayed in their inventory knowing that the data is cached?