move some caching info+logic out of .travis.yml

Addresses #13136.