Hacker News new | ask | show | jobs
by mceachen 2345 days ago
I've seen hugely varying IPFS latency. `time curl -o- https://teetotality.blog/posts/how-this-blog-was-made/` took > 20 seconds, for example, yet https://ipfs.io/ipns/teetotality.blog/ returned in under a second.

I'd be really interested in a "what to do and what not do" wrt IPFS to avoid those 20s (or completely non-functioning) URLs.

1 comments

You're not really using IPFS here. The gateway that responds to the requests over at teetotality.blog is the one that actually communicates with IPFS, then forwarding the content to you.

The traditional web works with the concept of timeouts set by the owner. So if you request some content, and it's unable to find it within X seconds, the request gets cancelled.

IPFS (the network, not gateways) works differently, as the use case is different. Basically, there is no "requests". You simply put in a "ask" in the DHT about who has this content. If someone finds someone who provides the same content, then it tells you about it.

IPFS in itself doesn't have any timeouts, as the model is different. The use case is basically "I need this content, no matter how long time it takes and from who".

So, the difference between DNS addresses responding with different times, comes up to the maintainer of the gateway. Sometimes it's more connected to other nodes (like probably ipfs.io's gateways are) and sometimes they employ a longer cache for content (cloudflare's gateway have a long cache) and it makes the resolution time faster/slower.