Skip to content

Conversation

@AyronK
Copy link
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

3 participants