TL;DR — Quick Summary

sccache caches compilation results to speed up rebuilds. Supports Rust, C/C++, and more — with local, Redis, S3, or GCS backends. ccache for the modern age.

sccache makes builds faster. Cache compilation results locally or in the cloud — never compile the same code twice.

Installation

# macOS
brew install sccache

# Arch Linux
sudo pacman -S sccache

# Cargo
cargo install sccache

Configuration

# For Rust: add to ~/.bashrc or ~/.zshrc
export RUSTC_WRAPPER="sccache"

# For C/C++
export CC="sccache gcc"
export CXX="sccache g++"

# Cloud backends
export SCCACHE_REDIS="redis://localhost:6379"
# or
export SCCACHE_BUCKET="my-sccache-bucket"
export SCCACHE_REGION="us-east-1"
# or
export SCCACHE_GCS_BUCKET="my-sccache-bucket"

Usage

# Start the sccache server
sccache --start-server

# Check stats
sccache --show-stats

# Zero stats
sccache --zero-stats

# Stop server
sccache --stop-server

# Build with Rust (automatic with RUSTC_WRAPPER)
cargo build

# Build with C/C++
sccache gcc -o output main.c

Summary

  • sccache caches compilation results for Rust, C/C++, and more
  • Local disk, Redis, S3, or GCS cache backends
  • Set RUSTC_WRAPPER=sccache for automatic Rust caching
  • 50-80% faster rebuilds on cache hits
  • By Mozilla — production-tested, cross-platform