cloudflare/vinext

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

Open

#1.487 aberto em 22 de mai. de 2026

Ver no GitHub
 (0 comments) (0 reactions) (0 assignees)TypeScript (329 forks)github user discovery
adapter-api-e2ehelp wanted

Métricas do repositório

Stars
 (8.120 stars)
Métricas de merge de PR
 (Mesclagem média 1d 1h) (462 fundiu PRs em 30d)

Description

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.

Guia do colaborador