Native action cache and CAS
BoringCache speaks the HTTP cache paths Bazel expects instead of turning Bazel outputs into generic archives.
Getting started
On this page
j / k move between sections.
Docs / Adapter commands / Bazel
Give Bazel a shared HTTP action cache and content-addressable store without replacing Bazel's action keys or build graph.
BoringCache speaks the HTTP cache paths Bazel expects instead of turning Bazel outputs into generic archives.
Use the same cache from a developer laptop, GitHub Actions, or another CI runner.
Restore-only tokens can read remote cache while trusted jobs publish action outputs.
Keep the command and cache tag in .boringcache.toml, then use the same boringcache bazel entrypoint locally and in CI. The action cache and CAS stay Bazel-native. The adapter downloads top-level outputs by default; download-outputs and remote-max-connections are configured under [adapters.bazel.options]. The separate bazel-reapi command uses gRPC and a separate cache namespace.
[adapters.bazel] tag = "bazel-cache" command = ["bazel", "build", "//..."] # Run: boringcache bazel
With Bazel 7.4 or later, the CLI adds --execution_log_compact_file after bazel build, bazel test, bazel run and bazel coverage. Bazel writes a compressed record of each action it ran or served from a cache to a temporary file, and the CLI reads it after the command and removes it. The flag does not change action keys, and Bazel keeps its analysis cache between builds.
The run page and the run API list every action: its target and mnemonic, where it ran, whether the remote cache or a disk cache served it, its exit code, and when it started and how long it took. Command lines, environment variables and input files are not recorded.
Every request Bazel makes to the cache is recorded too, with its result, size and time, so a run shows both what Bazel ran and what the cache served.
A command that passes its own --execution_log_json_file, --execution_log_binary_file or --execution_log_compact_file keeps its log, and the CLI records no actions. The same applies when any line of a bazelrc file the command loads contains an execution log option, including a line for a config the command does not use, because Bazel accepts only one execution log. Before it adds the flag, the CLI runs bazel --version with the command's environment; when Bazel is older than 7.4 or reports no version within 10 seconds, the command runs unchanged and the CLI records no actions. Commands that run no actions, such as bazel query, and commands run through another program record only the cache requests.
The Action starts the Bazel adapter and gives the later Bazel step its remote-cache settings.
- uses: boringcache/one@1781572d7b3ec5aef652f8ba479b981439b2776b # v1.48.2 with: trust-policy: auto mode: bazel - run: bazel build //...
Approve the repository through Connect CI and grant the job contents: read and id-token: write. The Action uses that Machine connection. Pull requests restore by default; trusted jobs may publish. See the authentication example in the GitHub Actions reference for scoped credentials when OIDC is unavailable.
gRPC builds the same upstream commits with BoringCache, Bitrise Build Cache, BuildBuddy, Depot Cache, GHA Cache and NativeLink on the same runner classes.
Bazel
Benchmark →RPC framework. The C++ library and its CSM greeter client and server, built with Bazel.
Average restore, build and save · lower is better
4 vCPU · 16 GB · Ubuntu 24.04 x86-64
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.
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.
| Cache | Cold | Warm | CPU |
|---|---|---|---|
| BoringCache Remote cache | 28 min 3 s | 1 min 46 s | Cold: Intel Xeon 6973P-C · Warm: AMD EPYC 7763 |
| BuildBuddy | 26 min 52 s | 1 min 51 s | AMD EPYC 9V45 Different CPU |
| Depot Cache | 54 min 20 s | 2 min 26 s | Cold: AMD EPYC 7763 · Warm: AMD EPYC 9V74 Different CPU |
| GHA Cache Bazel --disk_cache restored and saved by actions/cache | 27 min 2 s | 73.7 s | Cold: Intel Xeon 6973P-C · Warm: Intel Xeon Platinum 8573C Different CPU |
| NativeLink NativeLink server on the runner | 26 min 6 s | 11 min 35 s | Cold: AMD EPYC 9V45 · Warm: AMD EPYC 7763 Different CPU |
BoringCache · GitHub runner · 4 vCPU
99.5% of 82,319 lookups over 9 builds
Check the tool's own reference when you need cache-key rules, build settings, or version-specific behavior.
Compare every supported command, protocol, and Action mode in one place.
Adapter command index →Need help or found something unclear? Open an issue or browse the CLI repo.
We use cookies to understand how people use BoringCache. Privacy policy