Skip to content

Crate metadata requests take very long on crates with a lot of features #7269

@carloskiki

Description

@carloskiki

Current Behavior

When requesting metadata through shields.io for a crate I maintain, icondata, I have to specify a specific version of the crate in order for the API request to complete.

This crate makes heavy use of feature flags which bloats the response payload of the API. A request for a specific version is fine, with a payload size of ~1MB, but when I don't specify a version i.e., when every version's metadata is included, the payload is ~20MB, which seems to make the request timeout on shields.io's side.

Expected Behavior

I know this is partly due to how shields.io works, but perhaps being able to specify the version as latest instead of a specific semver would help. An example of what it would enable use to do is request the license of the latest crate without requesting every crate's metadata.

Steps To Reproduce

GET request to https://crates.io/api/v1/crates/icondata
vs.
GET request to https://crates.io/api/v1/crates/icondata/0.1.0

Environment

  • Browser: Chrome version 118.0.5993.70
  • OS: Mac OS (Apple silicon m1)

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-backend ⚙️C-enhancement ✨Category: Adding new behavior or a change to the way an existing feature works

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions