Shared Compilation Cache for C/C++ and Rust. Use for accelerating builds by caching compilation results across projects and CI/CD.
Use this library when:
cargo install sccache or download binaryRUSTC_WRAPPER=sccache| Category | File | Purpose | Condition |
|---|---|---|---|
| Core Concepts |
| sccache fundamentals |
| Understanding the basics |
| Knowledge | Best Practices | Caching strategies | Optimal performance |
| Rules | Setup | Installation and env vars | New project setup |
| Rules | Local Cache | Disk-based caching | Local development |
| Rules | Remote Cache | S3, GCS, Azure, R2 | CI/CD optimization |
| Rules | Cargo Integration | Rust builds | Cargo projects |
| Rules | CI/CD | GitHub Actions, etc. | Automated builds |
| Rules | Monitoring | Cache hit rates and stats | Performance tracking |
# Install
cargo install sccache
# Set environment
export RUSTC_WRAPPER=sccache
# or for C/C++
export CC="sccache gcc"
export CXX="sccache g++"
# Build
cargo build
# View stats
sccache --show-stats
# Zero stats
sccache --zero-stats