Allow optional caching in failed builds
It's possible that you have a configuration where the outcome of the pipeline has nothing really to do with the quality of the cache. For example, you may be syncing quite a lot of NPM dependencies that are otherwise unchanged by your code. Throwing this valuable cache away because your own code failed to build is not an efficient use of time and resources.
This is particularly exacerbated when getting an initial pipeline working and nothing is ever cached until your first green checkbox shows up.
Just like it's possible to specify artifacts:when =
always, it should be possible to specify
cache:when = always.
Links / references
In the documentation we should highlight this as a way to speed up pipelines when you're caching external dependencies, and also mention it in the efficiency docs.
What is it?
Why should someone use this feature? To save time on failed builds.
What is the underlying (business) problem? Productivity.
How do you use this feature? Add
cache:when = always to
Save time on subsequent failed builds.
Make sure these are completed before closing the issue, with a link to the relevant commit.