open-services / open-registry

Community Owned JavaScript Registry
https://open-registry.dev
MIT License
266 stars 8 forks source link

Initial caching concurrency issue #12

Open victorb opened 5 years ago

victorb commented 5 years ago

When two requests for metadata or tarball that hasn't been fetched from registry.npmjs.org yet, happens at the same time, we most likely download the tarball twice as the current implemention is as simple as it can get.

We should make sure that there is only one in-flight request per non-cached metadata/tarball, even if multiple requests for the same package happens.