-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Cache key #286
Comments
Hello @mbrevda. Thank you for your report. I'll mark your issue as an |
or even the option to set custom restore keys. We use a rolling cache as our fallback when the hash of the lock file does not have a hit. Makes a considerable difference running I'd be happy to put together a PR? |
We have a different issue that will benefit from this enhancement, or from a separate solution. We are running a matrix of flows, with the node version changing between each flow. The node_modules to be uploaded are also different between the node versions, with packages running different compilation depending on the version, and the way things are now, that isn't taken into consideration. Allowing us to provide a custom cache key will solve these issues for us, but a simpler to implement fix for our issue would be to add the node version used to the cache key. |
Hello everyone. By our investigation we've decided not to add support of custom cache keys. The role of caching for node is to cover the majority of use cases without deep customization. It'll help novice users to setup faster their yml files. If you need more custom logic, the preferred solution will be using the action/cache task. @roikoren755, |
Is adding another param really that big of a deal? |
Could we at the very least have the recommended implementation from https://github.com/actions/cache? All the node examples recommend a restore key and with good reason. Restoring from something is much faster than restoring from nothing. https://github.com/actions/cache/blob/main/examples.md#node---npm |
Customizing of caching key is definitely not basic use-case so we should use @lharress ,
Example in |
@maxim-lobanov I do not believe that is the case, if it is then the documentation is misleading.
Specifically, this piece;
Unless I am misunderstanding, this mens if I have 1 item in the cache with the key Better explained with an example here - https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#example-using-multiple-restore-keys |
@lharress let me follow up with my team regarding it and return back with answer |
@maxim-lobanov Any update on this? Could the issue be re-opened while it's being discussed? |
Can we have this reopened or just updated? The presented arguments are strong enough and warrant a wider discussion. |
Related: #328 requests the addition of a default restore key. |
it's a lot faster to start from a 90% correct cache than an empty one re: actions#286 re: actions#323 re: actions#328
it's a lot faster to start from a 90% correct cache than an empty one re: actions#286 re: actions#323 re: actions#328
I would also like this. My use case is when changing the yarn setup from a local repo to a global cache, the cache needs to be busted. |
…actions#286) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.30.0 to 4.31.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.31.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The new cache option is great, but is also tightly coupled to the lock file hash. While this is a great way to ensure the cache is always a 1:1 match with the lock file, it ultimately makes the case a lot less useful in often updating, multiple branch setups - such as with dependabot. The ability to define a custom cache key would allow for longer term caches which with a wider ranges of package versions cached. To combat snowballing growth of the cache, the key could be set to include the current month, ensuing the cache is reset one a month.
The text was updated successfully, but these errors were encountered: