-
Notifications
You must be signed in to change notification settings - Fork 363
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
perf(maven): cache responses from Maven registries #1408
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1408 +/- ##
==========================================
- Coverage 69.52% 69.50% -0.03%
==========================================
Files 186 186
Lines 18326 18331 +5
==========================================
- Hits 12742 12741 -1
- Misses 4909 4913 +4
- Partials 675 677 +2 ☔ View full report in Codecov by Sentry. |
responses *RequestCache[string, response] | ||
} | ||
|
||
type response struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think of naming this as mavenResponse
but this structure is also quite general
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
after a offline discussion, we probably only want to cache only the not found status code, so I will mark this PR to draft. |
Follow up on #1045
Currently we cache the decoded Maven metadata and projects after fetching from Maven registries. We are not able to know if a request is Not Found or not. We can avoid making redundant not found requests if we cache the whole response from Maven registries.
This PR caches the response body as well as the statue code. This greatly improves the resolution performance - resolving registry.xml improves from 20s to 5s.
A potential caveat is that the new cache may not work with the existing cache, however considering the cache expires after some time and this is still an experimental feature, I don't worry too much on this.