Why are all my caches gone?

I deleted the cache to one branch of my project (organization) to test if the cache was causing the failed build, and now all of my caches are gone: https://travis-ci.com/jtr13/cc19/caches

Any thoughts on why this is the case?

Did you perhaps push the button to do so?

No, I definitely didn’t do that. I believe I took cache: packages out of .travis.yml temporarily–would that delete all existing caches?

Looking forward, my build errors since it takes too long. I’m thinking of shrinking the project and building the cache up incrementally, as it was originally created. Are there any alternatives? That approach would be very time-consuming.


It does not.

I just remembered that caches also expire after a certain period (45 on .com) if no changes are made.

I didn’t think it would, good to know. The date doesn’t explain it either.

I managed to get a PR to pass by incrementally adding back packages: https://travis-ci.com/jtr13/cc19/builds/137210703

However, after merging, the build errored: https://travis-ci.com/jtr13/cc19/builds/137222095

Apparently the PR cache is not accessed after the merge, unfortunately.

Is my only option then to do the same thing on the master branch to build the cache back up?

One other thing: I noticed that caches from failed builds are saved whereas caches from errored builds are not. Therefore I had to make adjustments to force the build to fail to build up the cache incrementally, rather than just let it run and start again once it timed out. Is that the way it’s supposed to work?


Yes. The PR builds cannot “poison” the base branch cache. (If we allow this, a nefarious actor can inject some unwanted code into the cache when you don’t expect it, and can cause harm.)

Yes. Failed builds are expected to have useful things in cache, while errored builds are expected to be “unusable”.

Got it, all making sense now. Thanks.