-
Notifications
You must be signed in to change notification settings - Fork 30.9k
docs: clarify instance-local revalidation behavior in multi-instance … #92403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,12 @@ In the [cache handler API](/docs/app/api-reference/config/next-config-js/cacheHa | |
|
|
||
| ## Multi-Instance Considerations | ||
|
|
||
| > ⚠️ **Important:** In multi-instance or serverless environments (such as deployments on Vercel), revalidation is instance-local by default. | ||
| > | ||
| > Calling `revalidateTag()` or `revalidatePath()` only invalidates the cache on the instance handling the request. Other instances may continue serving stale content until they receive the invalidation event through a shared cache or coordination mechanism. | ||
|
||
| > | ||
| > To ensure consistent revalidation across instances, you should configure a shared cache handler (for example, using Redis or another external store). | ||
|
||
|
|
||
| When running multiple Next.js instances behind a load balancer, revalidation events are local by default. Calling `revalidateTag()` on instance A only invalidates the cache on that instance. Other instances continue serving the stale content until they learn about the invalidation. | ||
|
|
||
| The cache handler API provides two hooks for distributed coordination: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is repeating the first sentence on 63 no? and the platform mentioned here, does handle this already.