Buildless + SCCache

Build caching with SCCache and Buildless

Using SCache with Buildless

SCCache is the spiritual successor to CCache, rewritten in Rust with an emphasis on distributed compile execution as well as caching. It is primarily used with the Rust toolchain, but can be used with nearly any C-like toolchain, like CCache.

Selecting a backend

SCCache supports many backends, including an HTTP-based backend and direct use of Redis.

HTTP ("Webdav") backend

SCCache provides the WebDAV adapter for plain HTTP or HTTP+TLS remote backends; it uses the SCCACHE_WEBDAV_* set of variables, which should be set as demonstrated below:

SCCACHE_WEBDAV_USERNAMEapikey (Literal value)

The HTTP backend is great because it is easy to understand, monitor, and diagnose; in some cases, though, the Redis-based adapter may perform better.

Redis backend

SCCache also supports caching via Redis-compliant backends. Buildless API endpoints natively speak Redis protocol. To configure this backend, you'll use the SCCACHE_REDIS variable, which specifies a formatted connection URL. Here's an example:

SCCACHE_REDISrediss://apikey:{your key}

Let's break this URL down into components:

rediss://Activate TLSBuildless uses TLS with publicly-verifiable certificates.
apikeyRedis usernameThe literal string apikey, or a specific org tenant ID.
{your key}Redis passwordYour API key should be used in this field.
redis.less.buildEndpointTraffic endpoint.
6379PortBuildless uses the standard Redis port, 6379.

For more information about using Redis with Buildless, see our Buildless + Redis guide.