Skip to content
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

Add an LRU cache for NPM responses to reduce HTTP traffic. #370

Merged
merged 4 commits into from
Jun 29, 2023

Conversation

calebbrown
Copy link
Contributor

This change introduces an LRU cache for NPM responses to avoid needless HTTP traffic for duplicate queries.

The hope is to improve the reliability of NPM requests by reusing cached data using the ETag in an "If-None-Match" header.

#337

Signed-off-by: Caleb Brown <calebbrown@google.com>
@calebbrown calebbrown requested a review from maxfisher-g June 28, 2023 07:23
Signed-off-by: Caleb Brown <calebbrown@google.com>
Signed-off-by: Caleb Brown <calebbrown@google.com>
pkg/feeds/npm/npm.go Outdated Show resolved Hide resolved
maxfisher-g
maxfisher-g previously approved these changes Jun 28, 2023
@maxfisher-g
Copy link
Contributor

Looks good, just a little more documentation would be good for future code readers

Signed-off-by: Caleb Brown <calebbrown@google.com>
@maxfisher-g
Copy link
Contributor

Thanks for the changes! Those are awesome comments :D

@calebbrown calebbrown merged commit 4a51bf9 into main Jun 29, 2023
@calebbrown calebbrown deleted the npm_lru_cache branch June 29, 2023 00:56
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