Overview
Binary caching works by:- Computing content hashes for your targets based on source files, dependencies, and build configuration
- Storing compiled binaries in local or remote storage
- Replacing targets with their cached binaries when the content hasn’t changed
- Warming the cache in CI to speed up local development
Tuist intelligently determines which targets are cacheable. Only frameworks, static frameworks, bundles, and macros are eligible for caching.
How It Works
Content Hashing
Tuist generates a unique hash for each target based on:- Source files - All Swift, Objective-C, and resource files
- Dependencies - Both direct and transitive dependencies
- Build settings - Configuration, Swift version, and compiler flags
- Cache version - Tuist’s cache version to invalidate incompatible artifacts
Cache Storage
Tuist supports two storage options:Local Cache
Fast, disk-based cache stored on your machine. Perfect for individual developers.
Remote Cache
Shared cache stored in Tuist Cloud. Enables team-wide cache sharing and CI/CD acceleration.
Getting Started
Enable Binary Cache
By default, binary caching is enabled for all Tuist projects. To use it:Generate with cache
Run your project with caching enabled:The first generation will build everything and populate the cache.
Warm the Cache in CI
Speed up CI builds by pre-building and caching frameworks:Remote Caching
Share cache artifacts across your team using Tuist Cloud.Setup
Configuration
Exclude Targets from Cache
Some targets shouldn’t be cached (e.g., frequently changing code):Disable Binary Cache
If you need to build everything from source:Cache Invalidation
The cache is automatically invalidated when:- Source files change - Any modification to Swift, Objective-C, or resource files
- Dependencies change - Updates to SPM packages, CocoaPods, or local dependencies
- Build settings change - Configuration, compiler flags, or Swift version updates
- Cache version bumps - Tuist updates that change the cache format
Best Practices
Structure your project for caching
Structure your project for caching
- Break your app into multiple frameworks
- Separate stable code from frequently changing code
- Use explicit dependencies instead of implicit ones
- Keep framework interfaces stable
Optimize CI builds
Optimize CI builds
- Run
tuist cache warmas the first step in CI - Cache the
~/.tuist/Cachedirectory between CI runs - Use remote cache to share artifacts across CI jobs
Debug cache issues
Debug cache issues
Check if a target is being cached:Clear local cache:
Performance Impact
First Build
Standard build timeNo cache available
Cached Build
70-90% fasterOnly changed targets rebuild
Full Cache
95%+ fasterNo compilation needed
Troubleshooting
Cache not being used
Cache not being used
- Verify
tuist generatecompleted successfully - Check if targets are cacheable (frameworks, not apps)
- Ensure you’re not using
--no-cacheflag - Verify remote authentication with
tuist auth
Outdated cache artifacts
Outdated cache artifacts
- Run
tuist cleanto clear local cache - Verify source files are properly tracked in git
- Check for uncommitted changes that affect hashing
Remote cache upload failures
Remote cache upload failures
- Verify network connectivity
- Check authentication status
- Ensure project is properly linked to Tuist Cloud
Next Steps
Selective Testing
Only run tests affected by your changes
Build Insights
Analyze build performance and cache efficiency