-
Notifications
You must be signed in to change notification settings - Fork 8
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
Bug: DoH client is missing in-memory cache #59
Comments
this should be resolved with the latest helia-verified-fetch and new dns updates. will confirm and then resolve |
I just tried with inbrowser.dev and it seems that even with ipfs/helia-verified-fetch#19 merged and included in the latest release, caching is not working properly. For example see in the second screenshot the logs to the console, most times it isn't resolved from cache. I'm gonna look into this. |
ipfs/helia-verified-fetch#34 should resolve this. I was under the false impression that we cache the DNSLink record in the datastore inside |
Strange that even though we had a bug (resolved by ipfs/helia-verified-fetch#34) with the cache in verified-fetch, it seems that I'll investigate this |
we should be able to close this once the latest |
helia ipns is released. we need to update verified-fetch and then update here. https://github.com/ipfs/helia/releases/tag/ipns-v7.2.0 |
This issue is resolved on |
Also confirming that from my tests this is resolved! |
@aschmahmann reported issues with multiple dns-queries still, but we're having trouble reproducting. Adin, can you provide the commit hash (found in HTML of root domain) of the site you're using, and a screenshot of what you're seeing for "multiple dns queries" ? |
@SgtPooki not able to see within the same browser request the HTML of the root domain to get the commit hash, but I've got this as the loaded js and there's a tag on the JS file name that IIUC should help with versioning. and here are the multiple dns requests |
@aschmahmann you should be able to go to |
@aschmahmann do you still get this error on inbrowser.dev? |
confirmed this is happening intermittently for Adin on latest. might be a race condition? might be CORS pre-flight being blocked causing issues? we need to dive in deeper, but it's a hard to repro problem that is inconsistent |
Found the problem can be seen when opening http://localhost:3000/ipns/docs.ipfs.tech without subdomain isolation (e.g. commit 1ef0094).
Bunch of times
/ipfs/assets/fooo
is being resolved (separate problem, but will go away when I finish #30):This edge case surfaced a weakness in our DoH implementation: no local cache.
And each time we trigger the same DNS lookup for
_dnslink.assets
:This works fast only because we added cache in https://github.com/ipshipyard/waterworks-infra/pull/30, but is wasteful and eats into the pool of HTTP request our SW can make.
We need to have in-memory cache which ideally respects TTL from DNS, or at least caches results for 1 minute before asking upstream for an update.
The text was updated successfully, but these errors were encountered: