-
Notifications
You must be signed in to change notification settings - Fork 364
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1408 +/- ##
==========================================
- Coverage 69.74% 69.71% -0.03%
==========================================
Files 186 186
Lines 18576 18581 +5
==========================================
- Hits 12956 12954 -2
- Misses 4920 4927 +7
Partials 700 700 ☔ 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.