Bugfix: How to fix Cloudflare Pages serving stale builds despite cod...

Documentation for Sessions

🐛 Bugfix: How to fix Cloudflare Pages serving stale builds despite cod...

Date: 2026-01-29
Time: 20:08:15 UTC
Session: editor2-73.30
Agent: documentation
Confidence: 100%
Status: ✅ Documented


📋 Decision Context

Question:

How to fix Cloudflare Pages serving stale builds despite code changes?

Task: Fix docs-angular Cloudflare deployment serving stale builds


🎯 Decision Made

Chosen:

Clear NX cache AND use --skip-nx-cache flag AND remove dist folder

Options Considered:

  1. Trust NX cache and redeploy
  2. Clear NX cache before building
  3. Clear NX cache AND use --skip-nx-cache flag AND remove dist folder

💭 Reasoning

NX caching is too aggressive for production deployments. Even with committed code changes, NX may serve cached build artifacts. The only reliable solution is: 1) nx reset, 2) rm -rf dist/apps/{app}, 3) build with --skip-nx-cache. This was proven in session 73 when production crashed but localhost worked - the deployed build didn't include bug fixes because NX served cached output.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation