Skip to content

fix: persist cacheControl for Pages Router ISR entries in FileSystemC… - #100495

Merged
unstubbable merged 1 commit into
vercel:canaryfrom
koreahghg:fix/pages-isr-cache-control-restart
Oct 21, 2026
Merged

unstubbable merged 1 commit into
vercel:canaryfrom
koreahghg:fix/pages-isr-cache-control-restart

Conversation

@koreahghg

Copy link
Copy Markdown
Contributor

What?

Fixed ISR cache lifetime persistence for Pages Router pages using the default FileSystemCache implementation.

Why?

Pages Router ISR cache entries did not persist their revalidation interval to disk. After restarting the server, the cache lifetime defaulted to 1 second instead of the configured revalidate value.

As a result, previously generated pages could be treated as stale immediately after a restart, and the expected Cache-Control header was not preserved.

This complements #99289, which addressed the same issue for the App Router, and covers the missing Pages Router case. See also #99288.

How?

  • Persisted the cache lifetime when writing Pages Router cache entries to disk.
  • Restored the persisted cache lifetime when reading cache entries from disk.
  • Added a Pages Router test case to test/production/app-dir/isr-cache-control-restart/ to verify cache behavior after a server restart.

Before the fix, the test failed because the first request after restarting the server returned a STALE cache status instead of HIT.

Verified that all 5 tests pass with both Turbopack and webpack using:

  • pnpm test-start-turbo
  • pnpm test-start-webpack

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: 6444c4a

@unstubbable
unstubbable merged commit ecf05d5 into vercel:canary Oct 21, 2026
212 of 214 checks passed
@github-actions github-actions Bot added the locked label Nov 4, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants