There is a feature of caching directories and dependencies but it is currently experimental and not available for public repositories directly. To add this support for public repositories we have to disable sudoing by adding sudo: false
to the top level of .travis.yml
. This will route the future builds to container-based infrastructure of Travis CI.
But the way caching works right now it has limitations, quoting from the documentation:
The caching tars up all the directories listed in the configuration and uploads them to S3, using a secure and protected URL, ensuring security and privacy of the uploaded archives.
Note that this makes our cache not network-local, it’s still bound to network bandwidth and DNS resolutions for S3. That impacts what you can and should store in the cache. If you store archives larger than a few hundred megabytes in the cache, it’s unlikely that you’ll see a big speed improvement.