Skip to content

Remote caching

A local cache makes your repeat runs instant. A remote cache shares those results across every machine — so CI builds what a teammate already built, and a fresh clone is fast on the first run. vx’s remote cache is opt-in, configured entirely with environment variables, and wire- compatible with Turborepo, so existing cache servers work without a shim.

Set two variables and remote caching is active:

Terminal window
export VX_REMOTE_CACHE_URL=https://your-cache-server.example.com
export VX_REMOTE_CACHE_TOKEN=your-token

That’s it — vx run now reads from and writes to the remote cache, layered on top of the local one (local first, then remote, then execute; remote hits hydrate the local cache).

VariablePurpose
VX_REMOTE_CACHE_URLCache server base URL. Required.
VX_REMOTE_CACHE_TOKENBearer token. Required.
VX_REMOTE_CACHE_TEAM_IDTenant id (teamId= query param).
VX_REMOTE_CACHE_SLUGTenant slug (slug= query param).
VX_REMOTE_CACHE_TIMEOUT_MSPer-request timeout.
VX_REMOTE_CACHE_SIGNATURE_KEYEnable HMAC artifact signing (see below).

The remote cache is fully optional at runtime. Any failure — a 500, a timeout, an auth error, a corrupt artifact — degrades to a local cache miss and the run continues. A remote outage slows you down; it never fails you. Remote lookups also fire concurrently in the background before scheduling, so network latency overlaps execution.

vx speaks Turborepo’s /v8/artifacts/ wire verbatim, so these work as-is:

Point VX_REMOTE_CACHE_URL at any of them.

Set a signature key and vx signs every uploaded artifact with HMAC-SHA256 (the Turborepo-compatible x-artifact-tag header) and verifies every downloaded one:

Terminal window
export VX_REMOTE_CACHE_SIGNATURE_KEY=a-shared-secret

With a key configured, vx rejects an unsigned response — a server or proxy can’t strip the tag to slip an unsigned artifact past you. A tampered artifact fails verification and degrades to re-execution; it never corrupts your build. Set the same key on every machine that shares the cache.

Set the variables as CI secrets and you’re done — see Continuous integration for a complete GitHub Actions example. Pair remote caching with --affected and most PRs only execute the packages they actually changed; everything else restores from a previous build.