CI: Cache/restore the npm network/package cache #43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This saves/restores the caches of just the packages.
(Not the installed and/or compiled versions, which are in node_modules;
We have already been caching those for some time now.)
Requirements for Adding, Changing, or Removing a Feature
Requirements for Adding, Changing, or Removing a Feature
Issue or RFC Endorsed by Atom's Maintainers
Discussed here: #33 (comment)
Description of the Change
Cache not only the post-install
node_modulesfolder, which we have been caching for some time now, but also the pre-install package/network cache thatnpmstores the packages from the registry in. This cache is there so you don't have to wait for your network connection to the registry, but can pull previously fetched packages straight from the hard disk.In this case, caching it moves the network hit to "somewhere else in the Azure DevOps servers", which should hopefully be faster than hitting the npm registry.
Alternate Designs
Don't do this, and keep doing what we've been doing.
I'm trying this because I want to see if it is, in fact, faster. It's an experiment.
Possible Drawbacks
Could be slower than just hitting the npm package registry.
Or this could somehow be unreliable or add undesirable complexity. However, the
Cache@2task is very well-behaved, being more likely to gracefully step out of the way and not do anything if it can't fully restore a cache. And npm fairly heavily validates everything that goes into/come out of the cache. So hopefully there's no issue with keeping the network/package cache around for multiple runs.Verification Process
Watch CI and see what happens.
Release Notes
N/A