Interview Prep/GitHub Actions/Caching, Artifacts, Runners & ARC

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.

All GitHub Actions questions Roadmap: GitHub Actions

More on Caching, Artifacts, Runners & ARC