Massive variance in retrieving cache

Retrieving the same cache ranges between 20 seconds and 100 seconds… Would be nice if it was more consistent. At the high end of the sprectrum, I would be better off not using a cache at all.

@rikur ,

As the description in the docs about Caches,

A workflow can access and restore a cache created in the current branch, the base branch (including base branches of forked repositories), or the default branch (usually master).

However, you need to understand the order of the retrieving.
For example, the branch feature-b is created based on the branch feature-a , and the branch feature-a is based on the default branch ( master ). And configure the workflow like as below:

- name: Cache build
  uses: actions/cache@v1
  with:
    path: path/to/cache
    key: build-cache-d5ea0750
    restore-keys: |
      build-cache-

1) When you run the workflow on the feature-b branch, the retrieving order is:
▷ Key build-cache-d5ea0750 in the feature-b branch scope
▷ Key build-cache- in the feature-b branch scope
▷ Key build-cache-d5ea0750 in the feature-a branch scope
▷ Key build-cache- in the feature-a branch scope
▷ Key build-cache-d5ea0750 in the master branch scope
▷ Key build-cache- in the master branch scope

2) When you run the workflow on the feature-a branch, the retrieving order is:

▷ Key build-cache-d5ea0750 in the feature-a branch scope
▷ Key build-cache- in the feature-a branch scope
▷ Key build-cache-d5ea0750 in the master branch scope
▷ Key build-cache- in the master branch scope

3) When you run the workflow on the master branch, the retrieving order is:

▷ Key build-cache-d5ea0750 in the master branch scope
▷ Key build-cache- in the master branch scope

The retrieving order will affect the retrieving time.

In addition, when you retrieve the same cache in different processes with different environments, the retrieving time may also be different.