ipfs / ipfs-companion

Browser extension that simplifies access to IPFS resources on the web
https://docs.ipfs.tech/install/ipfs-companion/
Creative Commons Zero v1.0 Universal
2.04k stars 323 forks source link

IPNS prefetching #643

Open magik6k opened 5 years ago

magik6k commented 5 years ago

I don't know how tricky this may be, but go-ipfs 0.4.18 has --stream flag for ipfs name resolve which makes it return names as they are discovered. It has some nice properties - names returned later are guaranteed to be 'better' (newer), last name returned before the stream is closed is always what would be returned by normal ipfs name resolve. This makes initial name discovery much, much faster, usually less than 1s from my testing.

When user goes to /ipns/Qm.. path, companion could try to call ipfs name resolve --stream instead going directly to the gateway and prefetching/start displaying stuff in something like a sandboxed iframe (if something like this exists)

lidel commented 5 years ago

Thank you, I agree this could improve UX of IPNS websites.

I imagine we would do this:

da2x commented 5 years ago

This could also be useful for framed content; like an iframe with a video or something.