Caching node_modules?
I'm looking for a solution for caching my node and bower dependencies rather than have them fetched at every build, which takes forever. (I know for production they should be in the git repo, but this happens to be a development system that for the moment at least is being pushed very frequently.)
Suggestions? Thanks!
@HolySamosa you could try this approach to set amount of seconds before fetching from server
$ cd $HOME
$ echo 'cache-min = 9999999' >> .npmrc
But I would recommend changing those ninths to something lesser so your deps would update, let's say, once a week.
@HolySamosa in general for nodejs/npm, npm caches the packages in ~/.npm and you control the expiry by setting npm config set cache-min <val> as @igor-galchevsky mentioned. Or use something like npm install --no-registry or npm install --cache-min <val>.
The other alternative I can think off would be to run like a proxy cache service: https://www.npmjs.com/package/npm-proxy-cache.
Now as re: specifically to OpenShift, it should cache the npm dependencies (don't think it handles bower) - well, use the cache unless you have a force_clean_build marker set. What does sshing into your app and running cd app-root/repo && npm install do? Does it pull down dependencies every single time?
Aah, I can see where this happen - if you using the Jenkins pieces to do the build - that the case?
That just might be starting up a new builder instance every single time, so there is no cache to reuse - its a brand new machine/instance/gear/container/
HTH
Closing this issue out.