mirror of
https://github.com/actions/cache.git
synced 2025-04-01 19:06:35 +00:00
Update README with more details on cache version and pitfalls around it
This commit is contained in:
parent
2b8105bdae
commit
ef428b1bdc
1 changed files with 2 additions and 0 deletions
|
@ -241,6 +241,8 @@ steps:
|
|||
|
||||
Cache version is a hash [generated](https://github.com/actions/toolkit/blob/500d0b42fee2552ae9eeb5933091fe2fbf14e72d/packages/cache/src/internal/cacheHttpClient.ts#L73-L90) for a combination of compression tool used (Gzip, Zstd, etc. based on the runner OS) and the `path` of directories being cached. If two caches have different versions, they are identified as unique caches while matching. This, for example, means that a cache created on a `windows-latest` runner can't be restored on `ubuntu-latest` as cache `Version`s are different.
|
||||
|
||||
Be aware that the same difference in the cache's `Version` can also happen for runners using the same OS and OS version. For instance, on a freshly set-up MacOS machine, there might be no `zstd` compression available, but it might be available on another MacOS machine as it was installed there e.g. as a dependency of a Homebrew package. In this case, caches created on either of those machines cannot be consumed on the other machine as they would use different compression algorithms. For troubleshooting it is useful to have a look at the raw logs to see which compression program and algorithm is actually used when the action is run.
|
||||
|
||||
> Pro tip: The [list caches](https://docs.github.com/en/rest/actions/cache#list-github-actions-caches-for-a-repository) API can be used to get the version of a cache. This can be helpful to troubleshoot cache miss due to version.
|
||||
|
||||
<details>
|
||||
|
|
Loading…
Add table
Reference in a new issue