Speed up build by caching Selenium binary
Right now we download (via curl) fixed Selenium binary version. With Travis CI cache feature enabled we can download it to folder that will be cached and therefore avoid future downloads.
That should speed up the build.
Large files that are quick to install but slow to download do not benefit from caching, as they take as long to download from the cache as from the original source:
https://docs.travis-ci.com/user/caching/#Things-not-to-cache
Thanks, I know that. That's why I haven't proceeded with implementation, but still not sure if that JAR file is considered as large and how fast it's being downloaded from web compared to from cache.
The download itself takes less than a second though.
https://travis-ci.org/minkphp/MinkSelenium2Driver/jobs/169868663#L215 4.38s including the 4s sleep for xvfb (which is overkill, but meaningless).
Caching vendor and installing with --prefer-dist should save ~14-17s. I'll submit PR to confirm.
Downloading from the google CDN should not be slower than downloading from the Travis cache IMO (which lives either in AWS S3 or in the Google infrastructure).
The 4s sleep should probably be removed. Starting xvfb is asynchronous but I'm quite sure we need it only when opening Firefox, i.e. when starting the first session. And we have other tasks running in between which should make it OK.