Infrastructure worth keeping — and kept patched.

Does a remote cache slow your build when it misses?

You may worry that asking a remote cache first makes every build slower when nothing is cached yet. With FosterStack Cache, a server you run yourself, a miss added about one second to a 17.5-second build on a GitHub-hosted CI machine, and a hit saved about four.

The short answer

What to do

Our advice, not a test result: turn the remote cache on in CI first. With the server on the same machine, as in our test, cold builds cost little and warm builds are faster. To set it up, see your first 15 minutes with a self-hosted build cache. To let CI fill the cache and laptops only read it, see let CI write, developers only read.

How we checked

We ran the same Gradle build three ways, seven times each, and timed the whole command.

SetupFastestMedianSlowest
No remote cache17.06 s17.54 s18.17 s
Remote cache, empty (a miss)16.83 s18.54 s18.67 s
Remote cache, filled (a hit)12.79 s13.41 s13.60 s

Where: a GitHub-hosted CI machine, Ubuntu 24 image 20261004.327.1, 4 vCPUs (AMD EPYC 7763), 16 GB. The run and its log are public, and the script is bin/bench-miss-cost.sh.

What: Gradle 9.8.0, Java 21.0.12.1, FosterStack Cache 0.2.1. The project had 4 modules of 150 generated classes each, and only the compile tasks ran.

How: the three setups ran in turn, seven times, after one warm-up round that was dropped. Every build used a fresh copy of the project, a new empty Gradle home and no Gradle daemon, so each one includes Gradle's start-up and the compile of its build scripts. Gradle's local cache was off.

Limits: the cache server ran on the same machine, so there was no network delay. Over a real network every lookup also costs a round trip, and a miss would likely cost more than shown. Not tested: Maven, other project sizes, other machines, tests and jars, a real network.