/

Pipelines and runners

Caching dependencies

Restore installs from a cache keyed on your lockfile and save minutes on every run.

updated

Oct 30, 2026

//

5 min read

A cache stores a folder between runs. The most common use is the dependency folder, keyed on a hash of the lockfile.

Add a cache

cache:
  path: node_modules
  key: lockfile-{{ hash(package-lock.json) }}
cache:
  path: node_modules
  key: lockfile-{{ hash(package-lock.json) }}
cache:
  path: node_modules
  key: lockfile-{{ hash(package-lock.json) }}

How keys work

If the key matches a saved cache, the folder is restored before your first step. If not, the step runs normally and the cache is saved at the end of a successful run.

Limits

  • A cache can be up to 5 GB.

  • Caches not used for 14 days are removed.

  • Caches are shared by branches of the same repository, never between repositories.

Still stuck? Try our AI support

Ask in plain words and get an answer from the docs. AI support by Chatbase, partner link.

Create a free website with Framer, the website builder loved by startups, designers and agencies.