Next.js 16 缓存示例(Cache Components)

全部示例基于 cacheComponents: true。每个页面展示可验证的缓存行为 (执行计数/时间戳对比),供可行性评估。

Webhook 按需失效

CMS 变更时调用:GET /api/revalidate?tag=feed&secret=$REVALIDATE_SECRET

需在环境变量设置 REVALIDATE_SECRET。Route Handler 中只能用 revalidateTag (第二参数 profile 必填,推荐 "max"),updateTag 仅限 Server Action。

评估要点(全局):