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:
parent
d00e8c3918
commit
4c6c9d4b27
6 changed files with 43 additions and 41 deletions
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue