三种失效 API 速查
| API | 行为 | 适用场景 | 可用位置 |
|---|---|---|---|
updateTag(tag) | 立即失效,写后即读 | Server Action 中用户操作后 | Server Action |
revalidateTag(tag, profile) | stale-while-revalidate | webhook、定时任务、后台刷新 | Server Action + Route Handler |
revalidatePath(path) | 失效整个路径 | 简单场景、不想管理标签 | Server Action + Route Handler |
Server Action 中优先用 updateTag,Route Handler / webhook 中用 revalidateTag。