Skip to content
Latchkey

What Is a Build Cache?

A build cache stores the results of build steps, keyed by their inputs, so that when the same inputs recur the cached output is reused instead of rebuilt. Compilers, bundlers, and dependency managers all use caches to skip redundant work. A correct cache speeds builds dramatically while still producing the same output a clean build would.

Why it matters

Most CI runs change only a small slice of a codebase, so rebuilding everything from scratch wastes time. A build cache turns that into incremental work. The risk is staleness: a poorly keyed cache can reuse outputs that no longer match the inputs, so cache keys must capture everything that affects the result.

Related concepts

  • Remote cache shares results across machines and CI runs
  • Layer caching is the container-image equivalent
  • Cache keys must include all build-affecting inputs to stay correct

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →