* [ GitHub security features  ](/en/actions/security-guides/using-githubs-security-features-to-secure-your-use-of-github-actions)
    * [ Automatic token authentication  ](/en/actions/security-guides/automatic-token-authentication)

  * Creating actions 

    * [ About custom actions  ](/en/actions/creating-actions/about-custom-actions)
    * [ Create a Docker container action  ](/en/actions/creating-actions/creating-a-docker-container-action)
    * [ Create a JavaScript action  ](/en/actions/creating-actions/creating-a-javascript-action)
    * [ Create a composite action  ](/en/actions/creating-actions/creating-a-composite-action)
    * [ Metadata syntax  ](/en/actions/creating-actions/metadata-syntax-for-github-actions)
    * [ Dockerfile support  ](/en/actions/creating-actions/dockerfile-support-for-github-actions)
    * [ Set exit codes  ](/en/actions/creating-actions/setting-exit-codes-for-actions)
    * [ Publish in GitHub Marketplace  ](/en/actions/creating-actions/publishing-actions-in-github-marketplace)
    * [ Share from your private repository  ](/en/actions/creating-actions/sharing-actions-and-workflows-from-your-private-repository)
    * [ Share with your organization  ](/en/actions/creating-actions/sharing-actions-and-workflows-with-your-organization)
    * [ Release and maintain actions  ](/en/actions/creating-actions/releasing-and-maintaining-actions)
    * [ CLI setup action  ](/en/actions/creating-actions/developing-a-third-party-cli-action)

  * [ Guides for GitHub Actions  ](/en/actions/guides)

  * [ GitHub Actions ](/en/actions "GitHub Actions") / 
  * [ Using workflows ](/en/actions/using-workflows "Using workflows") / 
  * [ Cache dependencies ](/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows "Cache dependencies")

#  Caching dependencies to speed up workflows

To make your workflows faster and more efficient, you can create and use
caches for dependencies and other commonly reused files.

##  In this article

  * About caching workflow dependencies 
  * Comparing artifacts and dependency caching 
  * Restrictions for accessing a cache 
  * Using the cache action 
  * Matching a cache key 
  * Usage limits and eviction policy 
  * Managing caches 

##  About caching workflow dependencies

Workflow runs often reuse the same outputs or downloaded dependencies from one
run to another. For example, package and dependency management tools such as
Maven, Gradle, npm, and Yarn keep a local cache of downloaded dependencies.

Jobs on GitHub-hosted runners start in a clean runner image and must download
dependencies each time, causing increased network utilization, longer runtime,
and increased cost. To help speed up the time it takes to recreate files like
dependencies, GitHub can cache files you frequently use in workflows.

To cache dependencies for a job, you can use GitHub's [ ` cache ` action
](https://github.com/actions/cache) . The action creates and restores a cache
identified by a unique key. Alternatively, if you are caching the package
managers listed below, using their respective setup-* actions requires minimal
configuration and will create and restore dependency caches for you.

Package managers  |  setup-* action for caching   
---|---  
npm, Yarn, pnpm  |  [ setup-node ](https://github.com/actions/setup-node#caching-global-packages-data)  
pip, pipenv, Poetry  |  [ setup-python ](https://github.com/actions/setup-python#caching-packages-dependencies)  
Gradle, Maven  |  [ setup-java ](https://github.com/actions/setup-java#caching-packages-dependencies)  
RubyGems  |  [ setup-ruby ](https://github.com/ruby/setup-ruby#caching-bundle-install-automatically)  
Go ` go.sum ` |  [ setup-go ](https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs)  
  
**Warning** : Be mindful of the following when using caching with GitHub
Actions:

  * We recommend that you don't store any sensitive information in the cache. For example, sensitive information can include