ncruces / go-dns

net.Resolvers with caching, opportunistic encryption, and DoT/DoH
https://pkg.go.dev/github.com/ncruces/go-dns
MIT License
41 stars 8 forks source link

Improve cache full behaviour #4

Closed ncruces closed 4 years ago

ncruces commented 4 years ago

Currently cache.go does eviction first, then insertion.

In principle, this is good, because it avoids unnecessary growth. But if we're updating a stale entry, this might lead to evicting a valid entry here.

A possible solution is to do insertion first, then eviction.