Next.js Discord

Discord Forum

How to Refresh a Different Route Programmatically in Next.js 15

Unanswered
Giant Angora posted this in #help-forum
Open in Discord
Avatar
Giant AngoraOP
Hi

I’m using Next.js 15 and I know that router.refresh() can be used to refresh the current route. However, I’m looking for a way to refresh a different route from the current page.

Is there any built-in method or workaround to trigger a refresh for another route while staying on the current route? Any guidance or examples would be greatly appreciated!

Thanks in advance!

5 Replies

Avatar
revalidatePath
Avatar
Giant AngoraOP
but it will revalidate for all users
i only want to invalidate user client router cache
Avatar
I don't think there's a way to do that except using unstable_cache and adding user specific cache tags
Avatar
Giant AngoraOP
yeah i know... i thought, good to ask