#use cache invalidateTags only impact domain, not global
1 messages · Page 1 of 1 (latest)
Hi @lone shale. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Based on the information provided in the knowledge sources, it appears that your observation about cache invalidation being domain-specific is correct. This behavior is by design in Next.js and Vercel's implementation of caching and revalidation.
According to the Vercel documentation on Incremental Static Regeneration (ISR):
"On-demand revalidation is scoped to the domain and deployment where it occurs, and doesn't affect sub domains or other deployments."
This means that when you use revalidateTag or similar methods to invalidate cache, it only affects the specific domain where the revalidation is triggered. This is a limitation of the current implementation, especially in multi-tenant or multi-domain setups.
To work around this limitation in a multi-tenant project, you might consider:
- Using a more generic tag that applies across all domains.
- Implementing a custom solution to trigger revalidation for all relevant domains when needed.
- Using
revalidatePathinstead ofrevalidateTag, although this might have broader effects than desired.
If you need to revalidate across domains, you may want to check the Vercel documentation for potential solutions or consider reaching out to Vercel support for more specific guidance on your use case.