News for hackers. Stuff that matters.
Re:The Magic Nix Cache, a GitHub Action for speeding up your... by duped on Monday June 26, 2023 @07:49PM (#36487361)
In order to support resolving dependencies to multiple versions (eg A and B depend on C but at incompatible versions), what npm does is drop the version override for C inside the nested node_modules directory (node_modules/A/node_modules/C, for example).

That means that node_modules (as created by a package-lock.json) can't really be cached or be built from caches since it depends on the particular version solution found by npm for a particular project.

So there's only so much that Nix can do. It can cache it about as well as using a naive caching scheme with actions/upload-artifact or similar (create a tarball of your node_modules and just cache it across runs, update when you need to).

Basically node_modules is inherently large. If you want better performance for caching dependencies use a better programming language environment.

Re:The Magic Nix Cache, a GitHub Action for speeding up your... by crabmusket on Tuesday June 27, 2023 @04:39AM (#36490402)
Or fewer dependencies!