GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(cache): change key to match actions/cache documentation by mmorel-35 · Pull Request #323 · actions/setup-node

Conversation

@mmorel-35

@mmorel-35 mmorel-35 commented Aug 26, 2021

Copy link
Copy Markdown

This PR change the cache key construction to fit those examples. It also add the use of restoreKeys and a more verbose log when retrieving fails.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

uenitty, oscard0m, juanpicado, andrewiggins, moltar, sandstrom, dekokun, nelson6e65, paescuj, ezze, and 3 more reacted with thumbs up emoji
All reactions
  • 👍 13 reactions
@mmorel-35
feat(cache): change key to match actions/cache documentation
117e7f5
Signed-off-by: Matthieu MOREL <[email protected]>
@merceyz merceyz mentioned this pull request Oct 16, 2021
ci(workflow): add cache to workflows using actions/setup-node verdaccio/verdaccio#2470
Closed
nigelzor added a commit to thrivehealth/setup-node that referenced this pull request Dec 8, 2021
@nigelzor
provide fallback cache keys
bd6483a
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

oxc commented Feb 1, 2022

Copy link
Copy Markdown

Does it make sense to fallback on a shared prefix without the package manager? They probably even use different cache directories.

ngraef reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@oxc oxc mentioned this pull request Feb 1, 2022
Caching fallback if there is no exact hit #328
Open
@ThisIsMissEm

ThisIsMissEm commented Mar 2, 2022

Copy link
Copy Markdown

Does it make sense to fallback on a shared prefix without the package manager? They probably even use different cache directories.

I would agree, falling back to a prefix without package manager probably isn't useful — they definitely use separate cache paths.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ThisIsMissEm ThisIsMissEm mentioned this pull request Mar 2, 2022
Seems caching is not working #416
Closed
3 tasks
@belgattitude

belgattitude commented Oct 10, 2022

Copy link
Copy Markdown

Hey just saw a link to this PR. I'd like to mention few discoveries I did recently

  • Yarn 3+ cache is automatically pruned when deps changes (it does not grow over time on the github cache).
  • Yarn 3+ cache is OS/arch independent (no need to prefix with OS)
  • Pnpm 7 is not pruned automatically,. There's a specific command https://pnpm.io/cli/store#prune. It's sometimes buggy.

You can see two examples based on @action/cache:

  • yarn: https://gist.github.com/belgattitude/042f9caf10d029badbde6cf9d43e400a
  • pnpm: https://gist.github.com/belgattitude/838b2eba30c324f1f0033a797bab2e31

It might be helpful.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@oxc

oxc commented Oct 11, 2022

Copy link
Copy Markdown
  • Yarn 3+ cache is automatically pruned when deps changes (it does not grow over time on the github cache).

I believe this is only true if you're not using the global cache in your project. From $(yarn config get cacheFolder) alone there is no way to distinguish the two.
See also https://yarnpkg.com/features/offline-cache#sharing-the-cache

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@belgattitude

belgattitude commented Oct 11, 2022

Copy link
Copy Markdown

True, if you look at the yarn gist you'll see that on ci the global cache is disabled YARN_ENABLE_GLOBAL_CACHE=false through an env. That makes it work independently of config.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@oxc

oxc commented Oct 11, 2022

Copy link
Copy Markdown

True, if you look at the yarn gist you'll see that on ci the global cache is disabled YARN_ENABLE_GLOBAL_CACHE=false through an env. That makes it work independently of config.

I see. For the record, I would hate it if the node action overrode my yarn config 😄

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@voxpelli voxpelli mentioned this pull request Feb 27, 2023
Add cache fallback with rolling timed expiration #702
Open
@voxpelli

voxpelli commented Feb 27, 2023

Copy link
Copy Markdown

Added an up to date evolution of this PR over here: #702

falling back to a prefix without package manager probably isn't useful

That PR fixes this ☝️

npm will not remove data by itself: the cache will grow as new packages are installed.

And it also fixes the infinitely growing cache problem that comes with this ☝️

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nigelzor added a commit to thrivehealth/setup-node that referenced this pull request Feb 28, 2023
@nigelzor
provide fallback cache keys
3ec743e
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
@dusan-trickovic dusan-trickovic added the needs eyes label Jul 12, 2023
deining pushed a commit to deining/setup-node that referenced this pull request Nov 9, 2023
@dependabot
chore(deps-dev): bump @vercel/ncc from 0.31.1 to 0.32.0 (actions#323)
39badb7
Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.31.1 to 0.32.0.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](vercel/ncc@0.31.1...0.32.0)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  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>
Thompson1985
Thompson1985 approved these changes Jan 2, 2025
View reviewed changes
@mmorel-35 mmorel-35 closed this May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@Thompson1985 Thompson1985 Thompson1985 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

needs eyes

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@mmorel-35 @oxc @ThisIsMissEm @belgattitude @voxpelli @Thompson1985 @dusan-trickovic
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.