move some caching info+logic out of .travis.yml; fixes #13136
Merge pull request #13269 from twbs/fix-13136

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