-
Notifications
You must be signed in to change notification settings - Fork 325
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
Improve dnslink resolution #69
Comments
Very good idea. Thank you! Current SDK provides two HTTP events (same for the future one)
Currently, all the redirect logic of this addon is in I guess we could hook into earlier There is a risk of dnslink lookup taking longer than the delay between those two events, but it would be only for an initial cache miss (and we could save cache between browser restarts). Should I give it a try? |
At the very least we could do an async XHR and |
- solves #69 without miss on first request
Reopening: I feel it may be a good idea to revisit this in WebExtension rewrite and see if something similar can be introduced. |
This commit removes false-positive redirects for paths that start with /ipns/{ipnsRoot} by following these steps: 1. is-ipfs test (may produce false-positives) 2. remove false-positives by checking if ipnsRoot is: - a valid CID (we check this first as its faster/cheaper) - or FQDN with a valid dnslin in DNS TXT record (expensive, but we reuse caching mechanism from dnslink experiment) This means we now _automagically_ detect valid IPFS resources on any website as long as path starts with /ipfs/ or /ipns/, removing problems described in #16 (comment) This commit also closes #69 -- initial load is suspended until dnslink is read via API, then it is cached so that all subsequent requests are very fast.
This would prevent possible delay of loading the page when DNS is slow (on bad connections DNS resolution can take few seconds).
So start loading page via normal HTTP and start resolving dnslink, if dnslink is available terminate normal HTTP connection and redirect to local gateway.
The text was updated successfully, but these errors were encountered: