Details
-
Type:
Improvement
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 3.0.0
-
Fix Version/s: None
-
Component/s: NPM
-
Labels:
Description
NPM specifies an abbreviated metadata format which is requested when the client sets a header, for packages with many versions the metadata can grow quite large.
npm cli version 4.5.0 introduced a more optimized npm package metadata response payload.
If the server receives a special header, Accept: application/vnd.npm.install-v1+json the server ( Nexus ) can optionally return a smaller package metadata response to the client.
The npm client internal to Nexus which fetches remote metadata on behalf of a proxy repository may also be able to utilize this as well when requesting package metadata from a remote. TBD.
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md
https://github.com/npm/npm/releases/tag/v4.5.0
https://blog.packagecloud.io/eng/2018/01/24/npm-registry-internals/
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format
Notice the size of package metadata is greatly reduced by sending this header:
> curl -sI https://registry.npmjs.org/npm -H "Accept: application/vnd.npm.install-v1+json" | grep -i Content-Length Content-Length: 929070
> curl -sI https://registry.npmjs.org/npm | grep -i Content-Length Content-Length: 8099623
Expected
- Outbound NPM proxy repo requests support asking remotes for abbreviated metadata
- Inbound NPM repo requests support responding with abbreviated metadata if asked for it
Attachments
Issue Links
- is related to
-
NEXUS-12821 add support for application/vnd.npm.install-v1+json abbreviated npm install package metadata in repository manager 2
-
- Closed
-
- relates
-
NEXUS-29547 already cached npm package tgz files are not served when request includes Accept header for abbreviated npm metadata and metadata cannot be cached
-
- Closed
-