Cache `node_modules` for www-gitlab-com pipelines
node_modules
, about ~8 seconds to push and ~8 seconds to pull) would eat up most of the gains caused by eliminating the yarn install
(which takes ~20 seconds). This seems to indicate that the Yarn/NPM network download time is normally very fast (probably due to CDN/etc, and yarn optimizations), almost as fast as downloading and unzipping the files from disk. #6358 (closed) still offers opportunities to do this caching via docker, though.
UPDATE NOTE: This MR will not be implemented. After looking at the initial numbers, the amount of additional time taken by the additional cache push/pull (~18500 files in We currently don't put the downloaded node_modules in the cache, like we do for the bundler vendor directory containing gems. This would probably be an easy and quick win to save 20-30 seconds, and also reduce the possibility of flaky builds (if the download happens to fail for network/etc issues - I'm not sure if we are using a local pass-through caching proxy or not)
POTENTIAL IMPROVEMENT: Small, probably 20-30 seconds for jobs which need this.
PROS:
- Easy to implement, low risk, same as we are already doing for gems
Edited by Chad Woolley