next.js
f380e4ab - Fix blocking revalidation for `fetch` and `unstable_cache` (#101077)

Commit
7 days ago
Fix blocking revalidation for `fetch` and `unstable_cache` (#101077) With Cache Components enabled, a page that uses cached `fetch` calls or `unstable_cache` can return a 500 during on-demand revalidation, including blocking regeneration after `expire`. Both wrappers skip the incremental cache lookup, so the final prerender cannot reuse the data computed by the prospective pass. It repeats asynchronous work and fails with `NEXT_STATIC_GEN_BAILOUT`. The incremental cache now reads the Resume Data Cache (RDC) during on-demand revalidation before it bypasses persisted entries. Both `unstable_cache` and cached `fetch` calls use this path, so the final prerender can reuse the prospective pass's result. This extends the fix proposed in PR #100895 to cached fetches and preserves the forced-refresh behavior introduced in PR #48516. The incremental cache continues to apply its tag invalidation checks before it returns an entry. Fixes #99866 Closes #100895 Co-authored-by: Arnaud Coral <arnaud@datarooster.io>
Author
Parents
Loading