circleci-orb icon indicating copy to clipboard operation
circleci-orb copied to clipboard

Simplify default cache_key

Open paulfalgout opened this issue 3 years ago • 1 comments

I think the current cache_key might be overly unique. 'cache-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}' It seems to me that including {{ .Branch }} is reducing the value of caching npm. If the checksum of package.json is the same and the architecture is the same, you'd want to reuse the cache would you not?

paulfalgout avatar Jan 19 '22 20:01 paulfalgout

I assume there's some reason that this is the default. That being said, I agree with you. My configuration, with irrelevant parts stripped out, is now:

- cypress/install:
  cache-key: cache-{{arch}}-{{ checksum "package.json"}}
- cypress/run:
  cache-key: cache-{{arch}}-{{ checksum "package.json"}}

This cut my cypress/install step from 2m 16s to 1m 51s. (The remaining time is due to issues unrelated to this post.)

samuelboland avatar Feb 19 '22 20:02 samuelboland

The current cache-key in 3.0.0 of the orb is now cypress-cache-{{ arch }}-{{ checksum "package.json" }}. Closing as resolved.

jennifer-shehane avatar Mar 01 '23 15:03 jennifer-shehane