Next.js Data Cache on multi-instance self-hosting: propagating revalidateTag across servers
0 reputation · 23 Jul 2025, 10:43 UTC
I'm planning a self-hosted Next.js App Router deployment behind a load balancer with multiple Node.js instances, and the Data Cache invalidation boundary is unclear to me.
My understanding is that fetch() responses with next: { revalidate: N } or tags are stored in a per-instance, filesystem-based cache. If a Server Action calls revalidateTag('products'), it runs on whichever instance handled that request, so the other instances would keep serving stale tagged entries until their time-based revalidation expires.
I've seen the cacheHandler configuration mentioned as the extension point for a shared cache (e.g., Redis-backed), but it appears to be experimental and the API has changed between releases, which makes me hesitant to build on it without knowing what is stable.
Assuming Next.js 15 in a production next start deployment:
- Is per-instance Data Cache isolation the documented behavior, and does
revalidateTagofficially have no cross-instance effect? - Is a custom
cacheHandlerthe intended mechanism for shared invalidation, and which version stabilized its interface? - Is there a supported alternative (e.g., relying solely on short time-based revalidation) that avoids the experimental API?