circleci-orb
circleci-orb copied to clipboard
Simplify default cache_key
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?
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.)
The current cache-key in 3.0.0 of the orb is now cypress-cache-{{ arch }}-{{ checksum "package.json" }}. Closing as resolved.