cloudflare/vinext

App Router ISR: `revalidate` / `fetchCache` / `force-static` / `unstable_cache` do not produce stable values

Open

#1,487 建立於 2026年5月22日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)TypeScript (329 fork)github user discovery
adapter-api-e2ehelp wanted

倉庫指標

Star
 (8,120 star)
PR 合併指標
 (平均合併 1天 1小時) (30 天內合併 462 個 PR)

描述

This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext main vs Next.js v16.2.6, 2026-05-22).

Problem

Many app-static and prerender tests show that vinext renders fresh values on every request rather than serving and revalidating cached values. unstable_cache, fetchCache, force-static, force-no-store, cache: "force-cache", cache: no-store, POST cache, and on-demand revalidate (via res.revalidate / updateTag) all fail to produce the expected caching semantics. ~18 failures concentrated in app-static.test.ts plus one prerender failure.

Expected: not "revalidate 10: 0.642956684821526"  // identical value should be cached but was not
Error: TIMED OUT: success (on-demand revalidate)

Estimated Impact

~18 test failures across the deploy suite.

Affected Test Suites

  • test/e2e/app-dir/app-static/app-static.test.ts (17 failures)
  • test/e2e/prerender.test.ts

Recommendation

  1. Reproduce first in vinext's own test suite. Cover the main directives independently: route-level revalidate, force-static, force-no-store, unstable_cache, fetch cache: 'force-cache' / 'no-store'. For each, verify the second request sees the cached/fresh value as expected.

  2. Implement the ISR cache. Wire a deploy-mode cache store (probably backed by Cloudflare KV/cache API) so that ISR-style values are persisted across requests.

  3. Respect every fetch directive. Make sure cache, next.revalidate, next.tags on fetch() calls all affect cache reads.

  4. Hook into the revalidate primitives. revalidatePath / revalidateTag / updateTag should evict matching entries from this store.

貢獻者指南