-
Notifications
You must be signed in to change notification settings - Fork 240
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
feat: add LRU cache for DID Documents #3651
feat: add LRU cache for DID Documents #3651
Conversation
3cd2d84
to
8499a42
Compare
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #3651 +/- ##
==========================================
- Coverage 71.79% 71.74% -0.06%
==========================================
Files 915 915
Lines 18312 18342 +30
Branches 1038 1040 +2
==========================================
+ Hits 13148 13159 +11
- Misses 4710 4727 +17
- Partials 454 456 +2 ☔ View full report in Codecov by Sentry. |
9d97712
to
e7440c1
Compare
e7440c1
to
8a60363
Compare
@paullatzelsperger sorry for the late review, but shouldn't we fetch again the DID document after some time? (even if it is present in the cache), in order to avoid to continue using an outdated version of the DID document? |
Yep, good point. Sounds like a task for a follow-up issue :) |
What this PR changes/adds
LruCache
to become aConcurrentLruCache
.ConcurrentLruCache
in theDidResolverRegistryImpl
to avoid excessive network traffic.Why it does that
Avoid excessive network traffic, when resolving the same did in close temporal vicinity.
Further notes
List other areas of code that have changed but are not necessarily linked to the main feature. This could be method
signature changes, package declarations, bugs that were encountered and were fixed inline, etc.
Linked Issue(s)
Closes #3645
Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.