refresh
API Reference for the refresh function.
refresh reruns dynamic work for the current route from a Server Action without invalidating server-side cached data.
Usage
refresh can only be called from Server Actions. Use router.refresh() in Client Components. It cannot be used in Route Handlers or other contexts.
Client cache behavior
Calling refresh clears the pages kept for back/forward navigation, but it does not invalidate other prefetched routes. A route prefetched before the Server Action can be reused until its stale time expires.
If a mutation changes cached data used by other routes, call updateTag or revalidatePath from the Server Action. These functions invalidate server-side cached data and currently clear prefetched routes from the client cache.
Parameters
Returns
refresh does not return a value.