cloudflare / cloudflare/vinext
App Router ISR: `revalidate` / `fetchCache` / `force-static` / `unstable_cache` do not produce stable values
- Dominant language
- TypeScript
- Stars
- 8.8k
- Forks
- 406
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 120
Description
> *This issue was created by an agent analysing CI failures from the [Next.js Deploy Suite](https://github.com/cloudflare/vinext/actions/runs/26282973805) (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
Assessment
This issue has not been assessed yet.