Reconsider "cache scope" for actions/cache

This is the relevant documentation section: https://help.github.com/en/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows#cache-scope

The cache action always searches for cache hits for key and restore-keys in the current scope (the branch containing the workflow run) first.

Basically, you’re replicating some of the mistakes made by Travis CI in taking away control from the users, in terms of how the cache is saved / restored.

Please reconsider this.

3 Likes

Thanks for the feedback! I’ve taken your suggestion and passed it along to the appropriate teams. Thanks again for reaching out :grinning:

2 Likes

What is the point of scoping the cache to a branch?

Now, when I use a branch/PR, the cache isn’t used until it’s generated the first time, which is slow?

EDIT: I added cache in a PR, and it wasn’t used on the master branch. But after reading the documenation, it seems like this is expected behaviour. However, once the cache is generated for master branch (parent of PR), it will be reused apparently. So, I’m okay with this.