Cache

GitHub's cache, and Turbo's, Nx's, Bazel's and GitLab's, kept in a bucket in your own AWS account: who may read what, what it keeps, and how to set it.

Jobs on AWS keep GitHub’s cache in your own AWS account. Nothing in your workflows changes: actions/cache, the setup actions’ caches and Docker’s type=gha reach it as they reach GitHub’s.

On a 16-CPU machine a 4 GB cache saved in 10 s and came back in 11 s. GitHub’s own cache took 12 s and 21 s.

Where it is kept

Each region your machines run in gets a bucket of the control plane’s, superci-plane-<id>-<region>, and a free S3 endpoint in its network. A cache never leaves your account and never goes over the internet. The dashboard makes both with your sign-in, beside each region’s network.

Who may read and write what

Each machine runs superci-cache, which holds no keys. For every lookup and save it asks the control plane with the job’s own token. The control plane checks that token against GitHub’s keys and signs links to the bucket that each do one thing.

A job reads and writes what GitHub would let it. A pull request reads its own branch’s caches, then its base’s and the default branch’s, and writes only its own.

What it keeps

On unless you turn it off. Settings → Cache, or:

superci caches retrieve                         # whether it is on, and what each repository keeps
superci caches update --size-gb=50 --days=14
superci caches update --enabled=false           # jobs use GitHub's own cache
superci caches list --repo=acmeci/api           # its entries: key, branch, size, last use
superci caches delete --repo=acmeci/api --confirm
  • Each repository keeps 25 GB unless set; the least recently used entries go first.
  • An entry unused for 7 days goes.
  • An entry saved 30 days ago is saved anew, however often it is used. The bucket removes anything older than 32 days by itself.

Docker images

On Ubuntu 26.04 machines (runs-on: superci/image=ubuntu26), the cache keeps the Docker images your jobs pull, for their next runs: the next run reads them from the bucket in its region instead of the internet. A local Supabase started in 37 s instead of 100 s; a 2 GB Playwright image pulled in 10 s instead of 22 s.

  • After a job, its machine keeps the image layers it pulled that the cache lacks, before it goes off. The job’s own time is never touched.
  • A job whose last run used 256 MB of images or more gets them from its start, on a fast disk of its own, in its price (about $0.02 an hour). Smaller images pull about as fast, so those jobs get Docker as it comes.
  • A job with no last run (a new workflow, a job renamed) goes by its repository’s other jobs: when they used images, it gets the cache from its start too.
  • A layer any registry gives to anyone may be read by every repository; any other only by the repositories that pulled it.
  • A job’s page and superci jobs retrieve say what it had from the cache and what it pulled. A layer goes after the cache’s days unused.

One job’s label can say otherwise: superci/image=ubuntu26/docker-cache=false gives it Docker as it comes, with nothing kept after it (to time a job cold, say); docker-cache=true gives it the cache from its start, whatever its last run used. superci machine update --docker-cache=false does the same for every job whose label does not say.

superci caches update --images=false            # Docker pulls every image as it always has

Turbo, Nx and Bazel

Their remote caches go to the same bucket, with nothing to set. Each machine tells them where: Turbo and Nx in the runner’s environment, Bazel in its system-wide settings. A workflow’s own settings still come first, so a Vercel token goes on to Vercel.

They carry no GitHub token, so what they may read and write is what GitHub said of the job: its own branch’s to write, and the default branch’s to read. A branch never writes where the default branch reads.

GitLab and Windows

GitLab jobs on AWS keep GitLab’s own cache there: GitLab’s runner is pointed at it as S3, by project and by the branch the job runs for. Windows machines on AWS use it too.

When it is not used

  • Machines on Cloudflare and Modal keep using GitHub’s cache.
  • When the control plane cannot be reached, jobs use GitHub’s cache as before.
  • Caches saved at GitHub earlier are used until they age: a lookup your bucket does not have is asked of GitHub.
  • Artifacts of GitHub’s jobs stay at GitHub.