Build Cache Hygiene
5 incident problems about Build Cache Hygiene. Start with the reviewed ones.
Read first
When the CI cache restores the wrong dependency graphAn InfraTree guide that lays out the first signals to check, the CLI verification order, common misdiagnoses, and a safe recovery path when package.json, the lockfile, and artifacts no longer agree even after a cache hit.CI/CD3 min readCI/CD deploy failed or shipped the old version: check by stage (trigger, build, push, rollout)When a pipeline never runs, goes red, or ends green with the old version still live, find which stage broke — trigger, build, registry push, deploy credentials or rollout — and the one command to check first at each stage.CI/CD4 min readDocker build cache not used (npm ci reruns): causes and fixes (COPY order, .dockerignore, CI cache)If changing only source files makes npm ci or pip install rerun on every Docker build, check COPY order, .dockerignore, ARG placement and the missing cache on CI runners, then fix it by copying the lockfile first and using a buildx cache.CI/CD3 min read
Recommended problems
Reviewed problems first, then problems with detailed scenarios.
All problems (5)
Docker build cache not used: npm ci reruns even when only the README changedDocker build cache not used: npm ci reruns even is a hands-on troubleshooting drill. Order Dockerfile steps so the dependency layer stays cached. build-cache-hygiene needs to be checked by narrowing scope, recent change, and the current live signal before rollback. 실무에서는 build...ReviewedCI/CDBeginner3 minFreeCICD-1216Cache restore looks healthy but one job still tests the wrong dependency treeA validation branch appears flaky because it keeps reusing a broad cache from another state.CI/CDAdvanced18 minProCICD-1223Matrix cleanup job deletes a needed cacheA multi-shard workflow uses a cleanup step to remove temp caches and occasionally deletes assets still needed by slower shards.CI/CDAdvanced18 minProCICD-1227Package restore succeeds but the later build still uses the old dependency graphA monorepo branch changes one workspace lockfile and CI still behaves as if the old dependency tree is present.CI/CDIntermediate17 minProCICD-1214Dependency restore is green but the cache came from the default branch and masked the real package changeThe run is fast and healthy, yet tests behave strangely because restore keys pulled a broader cache than the branch-specific lockfile warranted.CI/CDIntermediate18 minPro