When should you use setup-* built-in caching instead of `actions/cache`?
BeginnerConceptCaching, Artifacts, Runners & ARC
Answer
Almost always for language package managers: actions/setup-node (cache: npm|yarn|pnpm), actions/setup-python (cache: pip|poetry|pipenv), actions/setup-java (cache: maven|gradle), actions/setup-go (on by default). They compute correct keys from lockfiles and cache the global download cache, not node_modules. Use actions/cache directly for custom paths (Terraform plugin cache, Playwright browsers, compiled outputs) or when you need split restore and save.
More on Caching, Artifacts, Runners & ARC
How does `actions/cache` match keys and restore keys?IntermediateWhich caches can a branch restore from?AdvancedWhat are the cache size limits and eviction rules?BeginnerWhy cache the package manager's download cache rather than `node_modules`?AdvancedHow do `actions/cache/restore` and `actions/cache/save` help?AdvancedHow do you cache Docker layers in GitHub Actions?Intermediate