Moving CI caches to object storage
September 14, 2026
For about a year our CI runners kept build caches on a local disk. It worked until we had four runners and each one had a different, half-warm cache. Builds were fast on one machine and painfully slow on the others.
The fix was boring: push caches to an S3-compatible bucket, keyed by lockfile hash, and let every runner pull from the same place.
key=$(sha256sum package-lock.json | cut -c1-16) aws s3 cp "s3://ci-cache/node/$key.tar.zst" - | zstd -d | tar x || true
Two things surprised me. First, zstd at level 3 is the sweet spot; higher levels saved a few megabytes and cost more CPU than the download time they saved. Second, the bucket needs a lifecycle rule, otherwise you quietly pay for every cache key you ever produced.
Median pipeline time went from 11 to 6 minutes. The slowest runner is no longer a lottery.