♻️ Refactor: Reduce the Memory Usage of ignoreHeaders (#3322)

♻️ Refactor: reduce the memory usage of ignoreHeaders

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
This commit is contained in:
Kashiwa 2025-02-24 15:12:47 +08:00 committed by GitHub
parent b1e858bc76
commit ef4effc8a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,17 +35,17 @@ const (
noStore = "no-store"
)
var ignoreHeaders = map[string]any{
"Connection": nil,
"Keep-Alive": nil,
"Proxy-Authenticate": nil,
"Proxy-Authorization": nil,
"TE": nil,
"Trailers": nil,
"Transfer-Encoding": nil,
"Upgrade": nil,
"Content-Type": nil, // already stored explicitly by the cache manager
"Content-Encoding": nil, // already stored explicitly by the cache manager
var ignoreHeaders = map[string]struct{}{
"Connection": {},
"Keep-Alive": {},
"Proxy-Authenticate": {},
"Proxy-Authorization": {},
"TE": {},
"Trailers": {},
"Transfer-Encoding": {},
"Upgrade": {},
"Content-Type": {}, // already stored explicitly by the cache manager
"Content-Encoding": {}, // already stored explicitly by the cache manager
}
var cacheableStatusCodes = map[int]bool{