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

Return cached packets first before fetching from the network in the background #89

Open
Nuhvi opened this issue Oct 18, 2024 · 0 comments
Assignees

Comments

@Nuhvi
Copy link
Collaborator

Nuhvi commented Oct 18, 2024

Currently Pkarr clients only return cached packets if it failed to find anything on the DHT/resolvers/relay which means that you have to wait for the request_timeout (usually 2 seconds) before returning cached packets... that has proved to be wasteful in the case of cached packets with no-one to republish them.

The proposed change is to always return cached packets, and do the query for expired packets (in the background).

Note: this is the behavior of Resolvers already.

Pros: calling Client::resolve only takes longer if the client doesn't have any cached packets.

Cons: users will get outdated packets more often.

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

No branches or pull requests

1 participant