Skip to content

Getting started

YoCache has two halves that you set up once:

  • the server — a single static binary that stores and serves your shared sstate cache and source downloads;
  • the meta-yocache layer — enables your bitbake builds to use the cache and upload new artifacts to it automatically.

Download a pre-built binary for your platform from the Releases page and run it:

Terminal window
./yocache

By default it listens on port 6768 and stores artifacts under var/ in the current directory — see Server configuration for the flags that change this.

Prefer a container? See Running with Docker for docker run, podman run, and Docker Compose examples.

Quick check once it’s running:

Terminal window
curl http://yourcache.local:6768/healthz

Or open http://yourcache.local:6768/ in a browser — the server ships with an embedded dashboard at /ui/ (root redirects there) showing what the cache holds. No extra setup needed.

Add YoCache to your kasfile’s repos: section:

repos:
yocache:
url: https://github.com/bmoczulski/yocache.git
branch: main
layers:
meta-yocache:
local_conf_header:
yocache: |
YOCACHE_URL = "http://yourcache.local:6768"
# The juice!
INHERIT += "yocache"

Hash-equivalence is on by default too, once yocache is inherited: the layer points BB_HASHSERVE at the same server (ws:// on Yocto >= Scarthgap, the raw-TCP listener on older releases) unless you set BB_HASHSERVE yourself.

Terminal window
git clone https://github.com/bmoczulski/yocache.git

In bblayers.conf:

BBLAYERS += "/path/to/yocache/meta-yocache"

Then add the same configuration lines as in the kas snippet above to your local.conf or site.conf.

That’s it — run your bitbake build as usual. The first build populates the cache as it goes; every subsequent build, on any machine pointed at the same server, fetches what’s already there and uploads whatever it had to build or download fresh.

If the cache doesn’t have something, nothing changes for you: bitbake simply falls back to the upstream sources and builds locally, exactly as it would without YoCache.