Skip to content
Rust build cache

Rust build cache.
For CI and local worktrees.

Reuse downloaded crates and compiled work in CI. Start a new local worktree from a target snapshot, with its own files to build and change. Cargo checks what needs rebuilding.

Reusable Rust build work

Crates and dependencies

Reuse downloads

Cargo target state

Skip work that's still fresh

sccache results

Reuse matching compiler outputs

Fresh CI runner

Local builds

Three caches avoid three kinds of work.

Dependency downloads

Restore crates and Git dependencies so Cargo doesn't have to download them again.

Cargo target state

Reuse compiled outputs that Cargo considers fresh, avoiding the compiler call entirely.

sccache results

Reuse eligible compiler results when Cargo still needs to compile. Misses run the compiler normally.

Change a file. Rebuild the affected work.

The adapter preserves source freshness across target restores. Cargo checks changed inputs and reuses the outputs that still match your toolchain, target, and build flags.

Reuse your build in a new worktree.

Create a worktree for a branch or a coding agent without starting from an empty build cache. Local target snapshots reuse compiled work from a successful clean build in the same Git repository. Each worktree gets its own writable files.

Local snapshots are opt-in, need no remote credential, and have a configurable disk budget. Only empty targets are restored. Existing populated targets are kept.

Local snapshots in one Git repository

Local target snapshot

From a successful clean build

Feature worktree

Own writable target
Cargo checks freshness

Agent worktree

Own writable target
Cargo checks freshness

See Cargo and compiler-cache activity together.

Inspect restored build data, compiler-cache reads, and uploads in the same run.

Explore the workspace →
Zed · Workspace insights
Cache hits

BoringCache · GitHub runner · 4 vCPU

95.0% of 60,173 lookups over 30 builds

Served from the runner
Under 1 ms per read
Measured by sccache
3.4 ms per hit
Read from cache
46.1 GB

Rust benchmark

All Rust results →

Build times grouped by runner, with cold and warm builds shown separately.

Compare Zed build times by runner

Zed

Rust

Benchmark →

Code editor written in Rust.

Average restore, build and save · lower is better

GitHub runner

4 vCPU · 16 GB · Ubuntu 24.04 x86-64

Base · sccache compiler cache

BoringCache
30 min 45 s 30 builds
Depot Cache
30 min 38 s 30 builds
GHA Cache
32 min 29 s 30 builds
kache
31 min 57 s 30 builds

Plus · sccache, Cargo registry and target directory

BoringCache +
30 min 27 s 30 builds
GHA Cache + target
39 min 0 s 30 builds
mr-boxington
48 min 53 s 30 builds
Same CPU model

Builds of one commit can land on different CPU models. These ratios use only the build pairs where both caches ran on the same model; above 1.00× means BoringCache's total time over those pairs was lower.

Depot Cache vs BoringCache
1.03× · 8 of 30
GHA Cache vs BoringCache
1.03× · 15 of 30
kache vs BoringCache
1.24× · 5 of 30
GHA Cache + target vs BoringCache +
1.21× · 6 of 30
mr-boxington vs BoringCache +
1.78× · 9 of 30
6 CPU models recorded
BoringCache · sccache compiler cache
AMD EPYC 7763 (17 builds) · AMD EPYC 9V74 (6 builds) · AMD EPYC 9V45 (5 builds) · Intel Xeon 6973P-C (1 build) · Intel Xeon Platinum 8573C (1 build)
BoringCache + · sccache, Cargo registry and target directory
AMD EPYC 7763 (14 builds) · AMD EPYC 9V74 (6 builds) · Intel Xeon Platinum 8573C (6 builds) · AMD EPYC 9V45 (2 builds) · Intel Xeon 6973P-C (1 build) · Intel Xeon Platinum 8370C (1 build)
Depot Cache · sccache WebDAV backend
AMD EPYC 7763 (11 builds) · AMD EPYC 9V45 (10 builds) · AMD EPYC 9V74 (4 builds) · Intel Xeon Platinum 8573C (3 builds) · Intel Xeon 6973P-C (2 builds)
GHA Cache · sccache GitHub Actions backend
AMD EPYC 7763 (19 builds) · AMD EPYC 9V45 (5 builds) · AMD EPYC 9V74 (4 builds) · Intel Xeon 6973P-C (1 build) · Intel Xeon Platinum 8573C (1 build)
kache
AMD EPYC 7763 (11 builds) · AMD EPYC 9V45 (10 builds) · AMD EPYC 9V74 (5 builds) · Intel Xeon Platinum 8573C (2 builds) · Intel Xeon Platinum 8370C (2 builds)
GHA Cache + target · sccache plus actions/cache for registry and target
AMD EPYC 7763 (11 builds) · AMD EPYC 9V74 (5 builds) · Intel Xeon Platinum 8370C (4 builds) · AMD EPYC 9V45 (4 builds) · Intel Xeon Platinum 8573C (4 builds) · Intel Xeon 6973P-C (2 builds)
mr-boxington
AMD EPYC 7763 (13 builds) · AMD EPYC 9V45 (6 builds) · Intel Xeon Platinum 8573C (5 builds) · AMD EPYC 9V74 (4 builds) · Intel Xeon Platinum 8370C (2 builds)
Cold and warm builds

Each table is one workflow run with one build per cache. A row marked Different CPU ran on another CPU model than BoringCache at the same level, so part of its time difference can come from the hardware.

One cold and warm build per cache
Cache Cold Warm CPU
Base · sccache compiler cache
BoringCache sccache compiler cache 34 min 31 s 15 min 45 s AMD EPYC 9V45
Depot Cache sccache WebDAV backend 51 min 8 s 21 min 0 s AMD EPYC 7763 Different CPU
GHA Cache sccache GitHub Actions backend 48 min 54 s 21 min 51 s Cold: AMD EPYC 7763 · Warm: AMD EPYC 9V74 Different CPU
kache 42 min 21 s 5 min 0 s Cold: Intel Xeon 6973P-C · Warm: AMD EPYC 7763 Different CPU
Plus · sccache, Cargo registry and target directory
BoringCache + sccache, Cargo registry and target directory 51 min 8 s 12 min 54 s Cold: AMD EPYC 7763 · Warm: AMD EPYC 9V45
GHA Cache + target sccache plus actions/cache for registry and target 41 min 31 s 36 min 30 s Cold: AMD EPYC 9V74 · Warm: AMD EPYC 7763 Different CPU
mr-boxington 34 min 59 s 40 min 3 s Cold: AMD EPYC 9V45 · Warm: AMD EPYC 9V74 Different CPU
Cache hits

BoringCache · GitHub runner · 4 vCPU

95.0% of 60,173 lookups over 30 builds

Served from the runner
Under 1 ms per read
Measured by sccache
3.4 ms per hit
Read from cache
46.1 GB

Keep shared-cache publication in trusted jobs.

Give consumers restore access and publishers a separate permission. Connect supported CI through OIDC or use scoped credentials.

Connect your CI →

Separate readers and publishers

  • Trusted builds Publish shared cache for the next build Read + publish
  • Pull requests Restore cache without replacing it Read only
  • Local development Use a scoped credential for the workspace Scoped access

Common questions

Does BoringCache replace cargo or rustc?
No. Cargo still resolves dependencies and drives the build. BoringCache restores target state and provisions sccache around the command you already run.
How is this different from archiving ~/.cargo and target/?
The adapter preserves source freshness across restores and adds compiler reuse through sccache. Matching data is stored once across your workspace. Cargo still decides which crates need rebuilding.
Can I use target caching without sccache?
Yes. Set compiler-cache = "none" in the adapter config to keep target-state reuse alone.
Can a new Git worktree reuse a local Cargo target?
Yes. Enable local target snapshots to restore an empty target in another worktree of the same Git repository. Each worktree keeps its own writable files. Populated targets are left in place, and Cargo rebuilds work whose inputs have changed.
Do local snapshots need remote cache credentials?
No. Local target snapshots stay on your machine and have their own disk budget. Remote dependency, target, or compiler caches need workspace access separately.
Read the Cargo setup guide →

Can I help with your build?

Send me a repo or a workflow and I'll take a look. I've spent more than a year on slow Docker, Cargo and Bazel builds in CI.

Get help with your build

Set up Cargo caching

Install the CLI. Run onboarding to connect your repository and configure your cache.

30-day trial. No credit card required.

curl -sSL https://install.boringcache.com/install.sh | sh
boringcache onboard
boringcache cargo