>-Currently,`revalidatePath`invalidatesalltheroutesinthe[client-sideRouterCache](/docs/app/guides/caching#client-side-router-cache) when used in a server action. This behavior is temporary and will be updated in the future to apply only to the specific path.
`revalidatePath` and [`revalidateTag`](/docs/app/api-reference/functions/revalidateTag) serve different purposes:
- **`revalidatePath`**: Revalidates a specific page or layout path
- **`revalidateTag`**: Revalidates data with specific tags across all pages that use those tags
When you call `revalidatePath`, only the specified path gets fresh data on the next visit. Other pages that use the same data tags will continue to serve cached data until those specific tags are also revalidated:
- **Page A (/blog)**: Shows fresh data (page re-rendered)
- **Page B (/dashboard)**: Still shows stale data (cache tag 'posts' not invalidated)
### Building revalidation utilities
`revalidatePath` and `revalidateTag` are complementary primitives that are often used together in utility functions to ensure comprehensive data consistency across your application:
```ts
'useserver'
import { revalidatePath, revalidateTag } from 'next/cache'
export async function updatePost() {
await updatePostInDatabase()
revalidatePath('/blog') // Refresh the blog page
revalidateTag('posts') // Refresh all pages using 'posts' tag
}
```
This pattern ensures that both the specific page and any other pages using the same data remain consistent.