Caching Strategies
Use this reference to optimize local and CI task execution.
Local Cache Basics
- Enable caching for stable targets (
build,test,lint,e2e). - Ensure target
outputsare explicit when artifacts are produced. - Keep named inputs focused; avoid over-broad invalidation.
Remote Cache Options
- Nx Cloud for managed remote caching.
- Self-hosted runners/plugins for regulated environments.
Optimization Patterns
- Use
dependsOnwith^buildwhere dependency builds are required. - Keep CI parallelism tuned to compute resources.
- Reset cache after significant executor/plugin refactors.
Common Pitfalls
- Cache enabled but no outputs declared.
- Shared config files missing from named inputs.
- Mixing inconsistent environment variables across CI jobs.