Docker cache physics · Go CLI · v0.1.0

Your cache hit.
Your disk didn't.

Find the Docker cache layer that failed—from invalidation and BuildKit transport to page-cache refaults, storage reads, PSI, and export tax.

go install github.com/zozo123/cache-is-king/cmd/cache-is-king@latest
cache-is-king doctor .

Needs Go 1.23+. Or download a prebuilt Linux/macOS binary from the v0.1.0 release.

CACHE IS KING · DOCKER PHYSICS

cold: 74.2s   warm: 9.41s   speedup: 7.89×
cached vertices: 91%
file refaults: 42,881
storage reads: 1.7 GiB

HIGH logical hits are not physically hot
HIGH image export dominates warm time

Sample report, illustrative values

One tool, three lenses

See the whole cache stack.

Docker reports logical reuse. Cache Is King adds repository structure, BuildKit phase attribution, and the kernel signals that reveal whether reuse was actually cheap.

01 · Doctor

Catch invalidation

Find broad copies, missing cache mounts, oversized contexts, unsafe secrets, and broken GHA cache scopes.

cache-is-king doctor .
02 · Benchmark

Measure BuildKit

Run isolated cold and warm builds and separate context, metadata, execution, cache transport, and export work.

cache-is-king docker --runs 3 .
03 · Compare

Evaluate page policy

Compare default Linux, MGLRU, and cache_ext policies using warm time, refaults, reads, PSI, and cache ratio.

cache-is-king compare default=a.json s3fifo=b.json
Local-first report viewer

Drop in your JSON.

The viewer runs entirely in your browser. Reports contain measurements and findings—not source files, build logs, or secrets.

Sample data: open your own JSON
From research to workflow

Persistence is not residency.

Blacksmith insight

Do not serialize what can stay put.

Persistent builder state can retain cache mounts and avoid repeated cache transfer. But persistent bytes can still be physically cold.

cache_ext insight

Do not retain scans over hot objects.

One-size-fits-all page eviction may retain streaming Docker work while evicting the small compiler hot set the next build needs.