docs: clarify instance-local revalidation behavior in multi-instance …#92403
docs: clarify instance-local revalidation behavior in multi-instance …#92403Akash504-ai wants to merge 2 commits intovercel:canaryfrom
Conversation
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
|
|
||
| ## Multi-Instance Considerations | ||
|
|
||
| > ⚠️ **Important:** In multi-instance or serverless environments (such as deployments on Vercel), revalidation is instance-local by default. |
There was a problem hiding this comment.
This is repeating the first sentence on 63 no? and the platform mentioned here, does handle this already.
|
|
||
| > ⚠️ **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. |
There was a problem hiding this comment.
Repeats the second sentence on 63, only adding revalidatePath
| > | ||
| > 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). |
There was a problem hiding this comment.
The ### Multi-instance with shared cache section mentions this though - and the Redix example is actually linked further down
|
Thanks for the feedback @icyJoseph, I have simplified the note to avoid duplication and removed the extra details. Let me know if this looks good |
|
|
||
| ## Multi-Instance Considerations | ||
|
|
||
| > **Note:** Revalidation is instance-local by default. |
There was a problem hiding this comment.
And once again, is this not the very same thing said in line 59? What is the problem you are trying to solve here.
|
Closing this as not relevant, thanks for the clarification. |
What?
Adds a clear warning in the "Multi-Instance Considerations" section to highlight that revalidation is instance-local by default in multi-instance or serverless environments.
Why?
While the behavior is already explained later in the section, it is not immediately obvious to most users—especially those deploying on serverless platforms like Vercel.
This can lead to confusion, as developers may assume that
revalidateTag()orrevalidatePath()invalidates cache globally across all instances, when in reality it only affects the instance handling the request.How?
Fixes #92402