MIT33 ecosystems · one binary · one TOML file

Let cachedaddyspeed up your CI/CD.

One small Rust binary that caches every package, image and download your builds pull, plus a self-hosted GitHub Actions cache.

$ docker pull ghcr.io/yashau/cachedaddy

cachedaddy: a relaxed dad with glasses and a moustache, arms crossed, leaning on a big cardboard box
§ 01 — How it works

Download the internet once.

Every CI job starts the same way: the same npm tarballs, the same wheels, the same base image layers, again and again, from registries that rate limit you. cachedaddy sits between your fleet and those upstreams. The first request fetches, stores the bytes once, and every later one is served from its own storage.

Six runners request the same object; cachedaddy fetches it from upstream once, streams it to all six, stores it, and serves the next six requests from its own storage.runner-01runner-02runner-03runner-04runner-05runner-06cachedaddyregistry.npmjs.orgupstream

→ 6 runners miss the same tarball at the same moment

6client requests
0upstream fetches
§ 02 — What makes it different

Things your pull-through cache doesn't do.

cachedaddy has one goal: be a damn good caching proxy for CI/CD. These are the parts you won't find bolted on to a general artifact manager.

Unique · 01

A self-hosted GitHub Actions cache

actions/cache, the setup-* caches and BuildKit's type=gha keep their caches on your own storage, scoped and token-checked the way GitHub does it. Workflows stay unchanged; self-hosted runners get one patch.

40%of all cache traffic by bytes, from under 1% of requests

Share of all cache traffic, measured

by bytes≈ 40%
by requests< 1%
Pointing runners at the cache
Unique · 02

Streams another replica's fetch in flight

When several replicas miss the same object, one fetches it and the others stream that fetch as it arrives. 40 runners on three replicas pull the same new 2 GB image: upstream sees one download.

How replicas share fills
Unique · 03

Read-through, and only that

The opposite of a heavyweight artifact manager. One job, a small operational surface, and disposable storage: lose the cache and it refills from upstream.

  • Not a package registry. You can't publish or host your own packages, images or builds in it.
  • No repository management. No promotion, no staging, no virtual repositories to curate.
  • No UI. Configuration is one TOML file; the state is in /metrics and /stats.
  • No vulnerability scanner. min_age and denylists are guards, not a scanner.
  • No user and role management. Address allowlists, tokens, passwords and OIDC per cache. That's it.
Unique · 04

Performance is gated on every PR

Every pull request that touches the code counts the instructions of a warm hit and a cold fill under Cachegrind, and fails on a rise over 2%. Slow creep doesn't get merged.

§ 03 — Correct before fast

Fast, correct and boring.

Point each client's standard setting at it. No client plugins, no patched package managers, and nothing about your network built in: every name, upstream and credential is configuration.

  • Verified before it is stored

    Every object is checked against the digest its ecosystem publishes, and its bytes are never changed, so your clients still verify end to end.

  • One fetch per object

    Concurrent misses share one upstream fetch, and every waiter streams the bytes as they arrive. Nobody waits for the fill.

  • Huge objects in parts

    Big blobs are fetched over several connections at once, then verified whole before they count as cached.

  • Honest freshness

    Artefacts are kept, indexes revalidated on the ecosystem's schedule. When upstream is down the last good copy is served, and the response says so.

  • Supply-chain guards

    min_age holds back versions younger than a set age, and denylists drop bad versions, for every client behind the cache at once.

    min_age = { packages = { "left-pad" = "7d" } }
  • Polite to upstreams

    A 429, or a 503 with Retry-After, holds that upstream off for every replica, while stale copies keep serving.

  • Built for ops

    Prometheus, OTLP, Loki and Sentry built in. JSON access lines, /stats history, purge, reload on SIGHUP, and a binary handover that refuses no connection.

    POST /log-level?level=debug&for=1h
  • Describes itself

    /llms.txt and /openapi.json are generated from the running config: every cache's URL and each client's exact setting, for people and coding agents.

    curl https://cache.example.org/llms.txt

33

ecosystems, built in

Every ecosystem is a protocol plugin, and a deployment runs any number of caches of each type.

What each one caches

Language registries

  • npm
  • PyPI
  • Maven
  • Go
  • crates
  • Composer
  • RubyGems
  • Hex
  • NuGet
  • Conda
  • pub
  • Swift
  • CRAN
  • CPAN
  • Julia
  • Conan

OS packages

  • apt
  • RPM
  • apk
  • Arch Linux
  • FreeBSD pkg
  • Homebrew

Containers and infra

  • OCI
  • Helm
  • Terraform/OpenTofu
  • Ansible Galaxy
  • Chef Supermarket

CI and tooling

  • GitHub Actions cache
  • git and Git LFS
  • Hugging Face Hub
  • Sigstore TUF
  • Go vulndb
  • Generic HTTP
§ 04 — Measured, not adjectived

Held to nginx serving a static file.

Warm hits come from the cache's own storage (sendfile on plain HTTP), and bodies stream to the client and to storage at once. The load tests measure throughput per CPU-second against nginx on the same machine.

Large files and the CI-shaped mix meet the 80% target; small files don't yet. On every hit cachedaddy also routes the request, looks the entry up, checks its freshness, records the read for eviction, and writes a metric point and a JSON access line. nginx just sends the file.

Method and raw numbers

Warm hits · throughput per CPU-second

nginx = 100%

target 80%
1000 MB file1 stream
88%
1000 MB file32 streams
88%
CI-shaped mix of sizes
80%
10 KiB files1 client
73%
10 KiB files32 clients
72%

Plain HTTP, same machine. Higher is better.

§ 05 — Quick start

Ten minutes to your first cache hit.

npm and PyPI on one host, plain HTTP on port 8080, blobs on disk, metadata in redb. Add ecosystems by adding [[cache]] tables.

01

Get it

The container image, a release tarball with SHA-256 sums and attestations, or a build from source. Linux on amd64 and arm64.
amd64 · arm64 · non-root · read-only root fs
docker pull ghcr.io/yashau/cachedaddy
02

Configure it

One TOML file. hosts is the name clients use to reach the cache; put your server's name in place of localhost.
config.toml
[[listener]]
address = "[::]:8080"
 
[[cache]]
name = "npm"
type = "npm"
hosts = ["localhost"]
path_prefix = "/npm"
 
[[cache]]
name = "pypi"
type = "pypi"
hosts = ["localhost"]
path_prefix = "/pypi"
 
[blob]
type = "fs"
path = "/var/lib/cachedaddy/blobs"
 
[metadata]
type = "redb"
path = "/var/lib/cachedaddy/metadata.redb"
03

Run it

The container runs non-root on a read-only root filesystem; /var/lib/cachedaddy is the one writable volume.
cachedaddy check-config --config config.toml # prints it resolved, defaults filled in
cachedaddy serve --config config.toml
04

Point your clients at it

Each client's own standard setting. No plugins. Every running cachedaddy also lists the exact settings for its caches at /llms.txt.
npm config set registry http://localhost:8080/npm/

GitHub Actions cache on self-hosted runners

Workflows stay as they are. The runner needs a small patch so it sends ACTIONS_RESULTS_URL to the cache, since the stock runner overwrites it.

Runner setup

Lose the cache and it just refills. Dad's not worried.

One small Rust binary, one TOML file, on one VM or a cluster of replicas. MIT licensed.