When a cached DNS answer expires, the next lookup has to wait for the upstream. Optimistic caching skips that wait: AdGuard Home serves the old answer right away and fetches a fresh one in the background.
Turn it on in DNS settings, under DNS cache configuration, or in the YAML:
dns:
cache_enabled: true
cache_optimistic: true
The answer from an expired entry goes out with a very short TTL, 10 seconds in current versions according to the docs, so the client asks again soon and then gets the refreshed record. Recent versions also let you set how long expired entries are kept with cache_optimistic_max_age.
On a home network it makes browsing feel a bit snappier, because many lookups are for the same few hundred names all day.
The trade-off is that you sometimes get an answer that is no longer correct. For most sites that does not matter. It does when you just moved a service to a new IP and wonder why one client still goes to the old one for a moment. While testing DNS changes, I’d switch this off for a while.
As always with the YAML: stop AdGuard Home before editing it.
Further reading: AdGuard Home configuration
Going deeper: Guide: AdGuard Home with Unbound: resolve DNS yourself instead of asking Cloudflare or your ISP