Testing a Build With Cold and Warm Caches
A cold cache requires producing all needed cached results. A warm cache tests whether the build reuses only compatible results.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace an invalid reuse
Build once using locale A and then try locale B if the output depends on locale. A warm rebuild that keeps A can expose an omitted cache input. Cache key design identifies that dependency.
Exercise both directions
A cache miss must compute a correct artifact. A cache hit must preserve its contract. Compare a warm result with a fresh result for the same declared inputs. Reproducible builds explain the expected equality.[1]
Compare equivalent outputs with and without reuse
Build a package from empty cache and then rebuild with the cache populated. The warm run may skip work, but the consumer-visible output should meet the same contract. Next change just one build input and verify the necessary entry misses. See build cache inputs.
Cold: compute all required outputs
Warm, unchanged inputs: reuse eligible outputs
Warm, changed target: do not reuse incompatible artifacts
Track what the cache explains about performance
Cold time includes fetching or compiling data that a warm run may avoid. Report which condition a timing describes. Compare output identity and correct invalidation before attributing a speedup to caching.