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:
Francois Tur 2018-08-31 17:26:43 -04:00 committed by Yong Tang
parent d00e8c3918
commit 4c6c9d4b27
6 changed files with 43 additions and 41 deletions

View file

@ -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