Closed bdantas closed 7 months ago
Check the cache-prefetch-trigger
and cache-prefetch-eligible
to keep the cache ready and up-2-date.
Yes! Keeping the cache fresh by prefetching nearly-stale entries is an even better strategy than what I had in mind. Thank you.
You may also want to look at perhaps adding a TTL-Modifier in front of the cache (between cache and resolver), that let's you set a min-TTL for all records, giving you more control over when the refresh happens.
Thanks, folbricht. I edited my config file accordingly. Am I correct that with this config I ensure cache entries will have initial TTL of at least an hour, all cache entries will be eligible for prefetch, and prefetch happens when entry has 10 minutes or less of TTL remaining? Is this a reasonable config for general household internet usage?
[resolvers.mullvad-dot]
address = "194.242.2.6:853"
server-name = "family.dns.mullvad.net"
protocol = "dot"
[groups.mullvad-updated-ttl]
type = "ttl-modifier"
resolvers = ["mullvad-dot"]
ttl-min = 3600
[groups.mullvad-cached]
type = "cache"
resolvers = ["mullvad-dot"]
cache-flush-query = "flush.cache."
cache-prefetch-trigger = 600
cache-prefetch-eligible = 3000
backend = {type = "memory", size = 10000, filename="/opt/routedns.cache", save-interval = 1800}
[listeners.local-udp]
address = "192.168.10.1:53"
protocol = "udp"
resolver = "mullvad-cached"
[listeners.local-tcp]
address = "192.168.10.1:53"
protocol = "tcp"
resolver = "mullvad-cached"
Almost, just one small issue, this config bypasses the ttl-modifier, you just need a small change to the cache config to actually use the modifier
[groups.mullvad-cached]
type = "cache"
resolvers = ["mullvad-updated-ttl"]
...
Ah, I understand how it works. Thank you.
routedns
is amazing. Thank you for creating it. Happy hacking!
I'm a happy user of routedns in my home's Tiny Core Linux-powered wireless router. This is my current config file:
In the interest of making my LAN users happy with very snappy page load times, I'm trying to make dns queries be always answered from cache even if cache entry is stale based on TTL. Is there a way to configure routedns so that cached records are always served optimistically, while the record is refreshed from upstream resolver and cached again in parallel?