mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
Move cache Keys to 64bit for a better dispersion and lower collision frequency (#2077)
* - change Key for cache to 64bits. * - change Key for cache to 64bits.
This commit is contained in:
6
plugin/cache/cache_test.go
vendored
6
plugin/cache/cache_test.go
vendored
@@ -167,9 +167,11 @@ func TestCache(t *testing.T) {
|
||||
state := request.Request{W: nil, Req: m}
|
||||
|
||||
mt, _ := response.Typify(m, utc)
|
||||
k := key(m, mt, state.Do())
|
||||
valid, k := key(m, mt, state.Do())
|
||||
|
||||
crr.set(m, k, mt, c.pttl)
|
||||
if valid {
|
||||
crr.set(m, k, mt, c.pttl)
|
||||
}
|
||||
|
||||
i, _ := c.get(time.Now().UTC(), state, "dns://:53")
|
||||
ok := i != nil
|
||||
|
||||
Reference in New Issue
Block a user