<div dir="ltr"><div dir="ltr">At Thu, 24 Jan 2019 22:16:25 +0100,<br>Fredrik Pettai via Unbound-users <<a href="mailto:unbound-users@nlnetlabs.nl">unbound-users@nlnetlabs.nl</a>> wrote:<br><br>> Will unbound _only_ serve hits from redis cache for keys with expired<br>> TTL if the configuration option "serve-expired: yes" is set?<br>> <br>> I've just tested redis cache very briefly, and it looks like keys with<br>> an expired TTL didn't get updated then I asked for the same name again.<br>> (If recursion happened, why not update the TTL in cachedb too?)<br><br>I'm not sure if I understand your question correctly, but IIRC the<br>intended behavior for the mixture of cachedb (regardless of the type<br>of the backend, redis or not) and serve-expired is as follows:<br><br>- when unbound finds an expired answer for a received query in<br>  in-memory cache, it will still return it to the client if<br>  sever-expired is yes.  it will also initiate a "prefetch" of the<br>  answer to possibly update the expired answer.<br>- in a prefetch, any cache including cachedb is ignored and it should<br>  always cause recursive DNS resolution<br>- If the recursive resolution succeeds, unbound updates its in-memory<br>  cache and cachedb backend with the updated answer<br><br>I've not played with this feature for some time, so something may have<br>changed since then.  But I believe it worked as described above last<br>time I tested the feature.  A quick read of the latest code also<br>seems to suggest it's still working that way.<br><br>Does this explanation answer your question?  Or are you saying that<br>this is your expected behavior but unbound doesn't work this way for<br>you?<br><br>--<br>JINMEI, Tatuya<br></div></div>