skyjake / lagrange

A Beautiful Gemini Client
https://gmi.skyjake.fi/lagrange/
BSD 2-Clause "Simplified" License
1.19k stars 62 forks source link

DNS cache #660

Open d47081 opened 5 months ago

d47081 commented 5 months ago

What about cache DNS results for some time instead of resolve host on every page request?

It would increase pages loading speed because currently gemtext open slower than huge HTML in FF

I mean something like about:config option:

network.dnsCacheExpiration
skyjake commented 5 months ago

While caching DNS results in-app could provide benefits in some cases, you are the first to report DNS being noticeably slow. May I ask if there is something in your local network setup that makes DNS particularly slow? Have you considered running a local DNS server that caches the results for you?

In general, I would rather not implement this kind of low-level networking features in Lagrange, as DNS caching is typically handled adequately by the operating system and the router(s).

d47081 commented 5 months ago

I've really found this latency on the machine connecting remote DNS over Yggdrasil (that has 1m cache for handshake on first connection). Also DNS provider had slow ping there, so resolve takes about 500ms of delays on each page request.

What's interesting, I have no discomfort in FireFox and found this problem by navigation in Gemini space only, where is strange to see loading tray for those few bytes of gemtext.

Agreed, that could be solved by system-mide cache, but it's not always useful (when some services sensitive to this cache applied commonly).

Suppose that's just useful feature request to make response immediate, call it fast page loading.