cloudflare/vinext

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

Open

#1.487 geöffnet am 22. Mai 2026

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (329 Forks)github user discovery
adapter-api-e2ehelp wanted

Repository-Metriken

Stars
 (8.120 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 1T 1h) (462 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide