-
Notifications
You must be signed in to change notification settings - Fork 13
Description
When providing a persistentCache option, the cache is only read if there is a memory cache miss, and the lookup fails. In this case, the result from the persistent cache is not saved to the memory cache. When this happens, it is likely to be a repeated failure (e.g. device is offline), so the persistentCache will be repeatedly hit for every dns request. As the cache is persistent, it is likely to be much slower to retrieve results. Maybe it makes sense for the persistentCache result to be saved in the memory cache?
Perhaps it would also make sense to consult the persistent cache directly after a cache miss, to allow lookups without hitting the network after an app restart, for example. This would likely require the cache to also return a ttl though.