Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions cordova-lib/src/cordova/lazy_load.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,7 @@ function cordova_npm(platform) {
// Returns a promise that resolves to directory containing the package.
function npm_cache_add(pkg) {
var npm_cache_dir = path.join(util.libDirectory, 'npm_cache');
// 'cache-min' is the time in seconds npm considers the files fresh and
// does not ask the registry if it got a fresher version.
var platformNpmConfig = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider totally removing calls to 'npm cache add'. Also, are we sure that npm doesn't set some kind of default cache-min ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will it work if I remove the caching altogether - sounds like a design change.

It does get a default cache-min of 10 seconds which if it is fine for npm, should be fine for us:
https://github.com/npm/npm/blob/2a5977e0c65b244e92d848fcd56f2f80ba8cdf3b/lib/config/defaults.js#L125. Their default scenario is quite similar to ours.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good.

'cache-min': 3600*24,
cache: npm_cache_dir
};

Expand Down
1 change: 0 additions & 1 deletion cordova-lib/src/cordova/remote_load.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ function npmCacheAdd(npmPackage) {
cacheDir = path.join(util.libDirectory, 'npm_cache');

npmConfig = {
'cache-min': 3600 * 24,
'cache': cacheDir
};

Expand Down