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
What Is a Remote Cache?A remote cache stores build outputs in a shared, networked location so they can be reused across machines, CI…
What Is Docker Layer Caching?Layer caching reuses unchanged container image layers across builds, so only the layers affected by a change…
What Is a Hermetic Build?A hermetic build depends only on explicitly declared, pinned inputs and is isolated from the host, so it prod…