Do not replace entries in cache when lookup has errored
This MR is a first iteration toward #281 (closed). The idea is not to replace an errored lookup in the cache once we have a correct lookup in memory. The idea is to check when an entry needs to be refreshed, if the new lookup has errored because of whatever reason (except if the ErrDomainDoesNotexist
) then we simply store the same response in the refreshed entry.
It also only allows an entry to exist in the cache for a maximum of cacheExpiry
duration by setting the refreshed entry created
timestamp to the original entry's.
Adding acceptance tests would be possible after we finish #520 (closed)
Related to #281 (closed)
Edited by Jaime Martinez