Build cache

Reusing the outputs of previous builds so unchanged work is skipped. The reason a second CI run finishes in seconds, not minutes.

why is CI so slowdon't rebuild everythingskip work that did not changecache the node_modules stepdocker layer cachingremote cacheincremental buildbuild chache

See it

Live demo coming soon

What it is

A build cache hashes the inputs of a task (source files, dependency lockfile, config, environment) into a key, and if that key has been seen before it replays the stored output instead of doing the work. You meet it as Docker layer caching, Turborepo or Nx task caching, actions/cache in GitHub Actions, Vite and webpack persistent caches, ccache, and Gradle's build cache.

Local caches speed up your own repeat builds. Remote caches are the real unlock on a team: one person (or the first CI run) builds a task, everybody else downloads the result. Reach for it when CI time is measured in coffee breaks, or when a one-line change in one package of a monorepo rebuilds all thirty.

Gotcha: a cache is only as honest as its key. Miss an input (an env var, a generated file, the OS image) and you get yesterday's artifact shipped as today's, which is far worse than a slow build. Order Dockerfiles so dependencies install before source is copied, keep caches scoped per branch or per lockfile hash, and always leave yourself a one-click way to bust the cache and rebuild clean.

Ask AI for it

Cut CI build time on this project with caching. Start by inspecting what is here: the package manager, whether there is a task runner or monorepo tool at all, what the CI workflow actually runs, and whether the repo builds container images. Then cache the package manager store between runs keyed on the lockfile hash, and turn on incremental or persistent caching for the build tool already in use. Add remote task caching only if the existing task runner supports it, and scope jobs to affected packages only if the tooling can tell you what is affected. Touch Docker layer ordering only if a Dockerfile exists, moving the dependency install above the COPY of application source. Add a manual 'skip cache' workflow input for clean rebuilds, and list every input that feeds each cache key so I can spot the one you missed.

You might have meant

ci cd pipelineaffected buildsbuild artifactdependency pinning lockfileci runner