Skip to content

File system uses fetch and pages cache only at build phase#124

Merged
AyronK merged 2 commits into
masterfrom
fix/fetch-cache-filesystem-on-runtime
Oct 23, 2025
Merged

File system uses fetch and pages cache only at build phase#124
AyronK merged 2 commits into
masterfrom
fix/fetch-cache-filesystem-on-runtime

Conversation

@AyronK
Copy link
Copy Markdown
Collaborator

@AyronK AyronK commented Oct 22, 2025

Fix: Limit cache writes to the production build phase.
Fixed #123.

This change ensures that cache writes to the file system using only occur during the build phase.

Changes

  • Added a condition to check process.env.NEXT_PHASE === PHASE_PRODUCTION_BUILD before calling CacheHandler.#writePagesRouterPage and CacheHandler.#writeFetch.

Impact

  • Prevents file system cache writes at runtime
  • Ensures the file system cache isn't unnecessarily modified at runtime (and does not grow larger over time).
  • No breaking changes, as this simply restricts file system writes based on the build phase. Preloading cache at instrumentation works as before.

@AyronK AyronK requested a review from Ljonel October 22, 2025 14:20
@AyronK AyronK merged commit 7a6729c into master Oct 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opt out file system caching

2 participants