How do you handle build cache invalidation problems ("works after clearing cache")?
IntermediateProductionMetrics, Performance and Cost
Answer
Make cache keys reflect all inputs: lockfile hash, tool version, OS and architecture, and a manual version prefix you can bump (v2-). Do not cache outputs that depend on things outside the key (generated files from env vars). When a bad cache is suspected, bump the prefix to start fresh instead of manually deleting. Periodically run a no-cache build (nightly) to detect correctness drift.
More on Metrics, Performance and Cost
How do you measure DORA metrics in practice?IntermediateWhat do the DORA performance levels look like, and how do you use them?IntermediateWhat are common ways DORA metrics get gamed or misread?AdvancedWhich pipeline metrics do you monitor for the CI platform itself?IntermediateHow do you cut CI cost without hurting developer speed?IntermediateHow do you use a remote build cache (Gradle, Bazel, Turborepo, Nx)?Advanced