Skip to content

Caching fallback if there is no exact hit #328

Description

@dbartholomae

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or request to improve the current logic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions