Skip to content

Reduce load on Crates.io #478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 21, 2022
Merged

Reduce load on Crates.io #478

merged 2 commits into from
Apr 21, 2022

Conversation

17cupsofcoffee
Copy link
Collaborator

This is a partial fix for #378 - adding ?include= to the API call excludes a load of information which we don't use from the response, and apparently reduces the number of queries from six to one. Should benefit our build times, and reduces the chance we get rate limited.

I also added a User-Agent header to the requests, in line with Crates.io's crawling policy (so they know who to shout at if we overload the API 😄)

Copy link
Member

@AngelOnFira AngelOnFira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Would it be worth adding an email, or are we easy enough to find do you think?

@17cupsofcoffee
Copy link
Collaborator Author

@AngelOnFira I can add the working group's email - wasn't sure if Zola would like headers without spaces but it looks like that works fine.

@17cupsofcoffee 17cupsofcoffee merged commit faa08a8 into master Apr 21, 2022
@17cupsofcoffee 17cupsofcoffee deleted the 17cupsofcoffee-crates branch April 21, 2022 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants