Skip to content
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

Caching fallback if there is no exact hit #328

Open
dbartholomae opened this issue Sep 5, 2021 · 4 comments · May be fixed by #702
Open

Caching fallback if there is no exact hit #328

dbartholomae opened this issue Sep 5, 2021 · 4 comments · May be fixed by #702
Labels
feature request New feature or request to improve the current logic

Comments

@dbartholomae
Copy link

Hi there,

at the moment, caching only hits if the exact same lockfile exists, but most of the time, even it the lockfile slightly changes, it is still beneficial to restore cache instead of downloading everything from scratch (most likely only ~1 dependency changed).
I would propose that, by default, cache falls back to node-cache-${platform}-${packageManager} instead of only checking node-cache-${platform}-${packageManager}-${fileHash}.
If this is of interest, I'm happy to provide a PR. It seems to only need a test and a one line change in https://github.com/actions/setup-node/blob/main/src/cache-restore.ts#L44

See also #304 (comment)

@dmitry-shibanov dmitry-shibanov added the feature request New feature or request to improve the current logic label Oct 21, 2021
@ngraef ngraef mentioned this issue Nov 2, 2021
nigelzor added a commit to thrivehealth/setup-node that referenced this issue Dec 8, 2021
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
@oxc
Copy link

oxc commented Feb 1, 2022

There seem to be implementations for this in #323 and thrivehealth@bd6483a

@belgattitude
Copy link

Just for sharing some workarounds with @action/cache

@IvanZosimov IvanZosimov removed their assignment Oct 18, 2022
@voxpelli voxpelli linked a pull request Feb 27, 2023 that will close this issue
@voxpelli
Copy link

New PR to fix this: #702

nigelzor added a commit to thrivehealth/setup-node that referenced this issue Feb 28, 2023
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
deining pushed a commit to deining/setup-node that referenced this issue Nov 9, 2023
Bumps [prettier](https://github.com/prettier/prettier) from 2.4.1 to 2.5.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@2.4.1...2.5.0)

---
updated-dependencies:
- dependency-name: prettier
  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>
@voxpelli
Copy link

Rebased and updated the PR over at #702, needed adaption after #744 was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants