DnsLibs
DnsLibs copied to clipboard
Allow persisting the DNS cache
This is quite important on mobile devices since they often change networks and this triggers new DNS queries. Persisting DNS cache would allow us to save quite a lot.
However, we should also allow:
- Easily clearing this (API? or just removing the file?).
- This feature should be optional.
@ameshkov Shouldn't we flush the cache on network change anyway?
@ngorskikh what's important is whether the upstream DNS server changed. If it didn't then we can reuse the cache.
@ameshkov I think, if upstream server is anycast or use ECS, resolve result may be different after network change even with the same upstream.
@sfionov well, yes, but would it cause any issues? I honestly doubt it.
The question is how much would the savings be if we employ a persistent cache (ideally -- persistent + optimistic caching). Can we run a simple experiment on an Android device and see what the savings are?