Revalidation Strategies — revalidatePath · revalidateTag · time-based
Revalidation Strategies — revalidatePath · revalidateTag · time-based
💡 Why Learn This? — The #1 cause of the 'I published a post but it's not showing' bug
4 Tools — Usage Matrix
1. Overview of 4 Tools
2. The tags System — The Most Powerful Pattern
More precise than revalidatePath — attach the same tag to fetches across multiple pages and they are all invalidated at once.
3. Hierarchical Tag Strategy
4. revalidatePath — Path-level Invalidation
Not as precise as tags, but useful for migrations and quick fixes.
5. Time-based Revalidation (ISR)
Ideal for data that rarely changes or has no mutations (blogs, docs, landing pages).
6. Summary — Decision Flow
💡 💡 Revalidation Best Practices — Top 5
1. Default policy — tags on fetch, revalidateTag on mutation
This single pattern covers 90% of cases.
2. revalidatePath is a fallback
Use it only when tags are tricky or you need a quick migration. Lower precision.
3. cache: 'no-store' only for truly user-specific data
Overusing it turns every page into SSR — higher server load and slower responses. Instead, isolate only that part as a Client Component.
4. revalidate: N heuristics
5. On-demand pattern — external invalidation via webhook
When a CMS or external system updates data, it sends a notification to trigger automatic invalidation.