Infrastructure worth keeping — and kept patched.

Your laptop builds reuse what CI already built

CI builds your code, and then your laptop builds the same code again from scratch. FosterStack Cache is a build cache server you run yourself: CI stores its results there, and your laptop takes them instead of redoing the work.

How it works

  1. You run the cache server, on your own machine or network. Both CI and every laptop point at it.
  2. CI builds and stores the results in it.
  3. Your laptop asks the cache before it builds. If the code is the same, it restores the stored result and skips the work.

It works with Gradle and with Maven. You can let only CI write to the cache and give laptops read-only access. For Gradle see let CI write, developers only read; for Maven see Maven remote build cache setup.

Does it work from a Mac laptop with Linux CI?

Yes, in our checks. A result stored in a Linux container was restored on a Mac, and a result stored on a Mac was restored in a Linux container. We checked this with Gradle and with Maven.

What has to match

Your laptop only reuses a result when its build inputs match CI's. In our tests these changed the cache key:

Keep those the same on laptops and CI. If your laptop still rebuilds, see why the Gradle hit rate is low or why the Maven cache is not restoring. To set it up, see Maven remote build cache setup and the Gradle setup in the CI-writes page.

How we checked

Stored onRestored onGradleMaven
LinuxMacfrom cacherestored
MacLinuxfrom cacherestored

One small project per tool, one build per cell, a new empty cache server and a fresh project copy each time. Gradle: four modules, Gradle 9.8.0, Java 21.0.12.1 on both sides, tested on Linux arm64 and on emulated amd64 with the same result. Maven: one module, Maven 3.9.9, all plugin versions pinned, Java 21.0.12.1 on the Mac and 21.0.7 on Linux. The Linux side was a container on the same Mac as the cache server, not a real CI runner. Not tested: Windows, real CI hardware. The Gradle runs covered the compile tasks only. Run on FosterStack Cache 0.2.1.