-
Notifications
You must be signed in to change notification settings - Fork 37
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
Recursive preload in js-ipfs is fetching MBs of refs data #67
Comments
@achingbrain am I right in thinking there is not currently a way to non-recursively pre-load things? I'm looking at https://github.com/ipfs/js-ipfs/blob/afcf142a7da8559500e4db0eaf739e9bfbf3a8b8/packages/ipfs/src/core/preload.js#L49 which is hardcoded to always pass The explorer app would like to be able to let ipld do a get on a cid without triggering a recursive fetch of a abitrarily large dateset on the preload nodes. Would it make sense to provide a config option to overide that flag, or another arguement option to the api methods that trigger preloading? cc @lidel |
or should i just disable pre-loading altogether? |
I think maybe just disable it entirely - preloading is supposed to increase the availability of newly added content, which isn't something ipld-explorer is for. |
Would we also lose some discovery power too? I assume preloading acts as a rough way to delegate dht look ups to the preload nodes too... |
Not AFAIK, the delegate routers are there to make DHT queries on behalf of js-IPFS nodes, but preloading is separate from that. |
Related: https://github.com/ipfs/in-web-browsers/issues/173 |
This depends on ipfs/js-ipfs#3510 |
we switched to helia + preload nodes are gone. this is no longer happening :) |
The first data-set listed on the IPLD Explorer is the "Project Apollo Archives" which is ~57GB... when we fetch the directory listing, everything works as expected, but in the background js-ipfs hits the preload nodes to recursively fetch the entire dag.
That's not great, as ipld explorer is built around the idea that you can fetch arbitrarily huge datasets by only fetch thing subset that you browse... as it stands multiple preload nodes fetch the entire data set and just the refs response alone means ~13MB of json listing out all the refs in the dag is streamed to th browser. For larger datasets the problem would get worse.
It's a nice optimisation for js-ipfs to recursively preload the entire dag, but its expensive for larger datasets.
TODO
The text was updated successfully, but these errors were encountered: