build cache

Saved results of earlier build steps that a build tool, such as Docker, reuses when nothing a step depends on has changed.

In more detail

A build cache stores each step's output under a key derived from its inputs, so an unchanged step is replayed instead of rerun. Changing an early input invalidates that step and everything after it. So put rarely changing steps, such as installing dependencies, first and often changing ones, such as copying source code, last.

Example

Turborepo keeps each task’s outputs under a hash of its inputs; the demo prints HIT for a match and MISS for a new hash.

Related terms

Taught in

References

Certification courses