Realign the structs to decrease memory footprint.

Add the timeout settings to address the connection drops.
This commit is contained in:
2023-12-14 17:16:38 +00:00
parent cd9c650226
commit b19b17b7c4
6 changed files with 40 additions and 48 deletions
+3 -3
View File
@@ -9,15 +9,15 @@ import (
)
type CacheEntry struct {
Value []byte
ExpiresAt time.Time
Value []byte
}
type Cache struct {
sync.RWMutex
bytePool sync.Pool
entries sync.Map
globalTTL time.Duration
bytePool sync.Pool
sync.RWMutex
}
func New(globalTTL time.Duration) *Cache {