Guides
Choosing a buildx cache backend
There are four cache backends and it is unclear which to use.
6 min read
There are four cache backends and it is unclear which to use.
Why it happens
Each trades transfer cost against portability, and the right answer depends on how often your image changes.
How to fix it
- inline: simplest, but only caches the final stage — avoid for multi-stage builds
- registry: portable across machines, but pays transfer cost on every build
- gha: convenient, but competes with your other caches for the same 10 GB
- local on a persistent builder: no transfer at all, and the fastest option available
Your next build could be twice as fast, at half the price
Start free. Migrating away is the same one line, and we publish that diff too.
Related
How to make CI caches actually persistCaches are configured but hit rate is low.How to work around the 10 GB cache limitYour caches exceed 10 GB per repository and start silently evicting.How to share a build cache across repositoriesEach repository maintains its own cache for the same shared dependencies.How to share a Docker cache between jobsEach matrix leg rebuilds the same layers.