Cache: Branch-independent caches

Created on 9 Feb 2020  路  3Comments  路  Source: actions/cache

The issue template said

Issues should only be opened on if the issue relates to code in this repository.

which I don't think is the case here. But it's still relevant and I don't know where else to file this.

I think caches should be accessible repository-wide, instead of being tied to a specific branch. The primary use case is caching external dependencies which can be shared between branches. If branch-specific caches are required one could include ${{ github.ref }} in the cache key (if slashes were handled properly that is, see #43).

enhancement

Most helpful comment

I 馃憤 this. The majority of our runs don't get a cache hit due to this making actions/cache mostly useless. I also think this should be mentioned in the README and Marketplace. I was pretty confused as to why none of my branches would get a cache hit despite the cache key being the same across runs.

All 3 comments

I 馃憤 this. The majority of our runs don't get a cache hit due to this making actions/cache mostly useless. I also think this should be mentioned in the README and Marketplace. I was pretty confused as to why none of my branches would get a cache hit despite the cache key being the same across runs.

In some way the branch specific cache is a feature that could be nice. One way to make this work could be to also "merge" the cache. When a PR is merged into a branch, then the branch should have the cache of the PR available. This would lead to correctly shared caches naturally, from what I can tell.

This issue overlaps with the discussion here: https://github.com/actions/cache/issues/79

Linking to that thread that has a nice solution (for my use-case, at least) for future explorers trying to debug cache-misses.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mands picture mands  路  5Comments

dcecile picture dcecile  路  6Comments

KhaledSakr picture KhaledSakr  路  3Comments

ConorSheehan1 picture ConorSheehan1  路  4Comments

FacetGraph picture FacetGraph  路  3Comments