mirror of
https://github.com/gofiber/fiber.git
synced 2025-05-31 11:52:41 +00:00
♻️ 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:
parent
b1e858bc76
commit
ef4effc8a0
22
middleware/cache/cache.go
vendored
22
middleware/cache/cache.go
vendored
@ -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{
|
||||
|
Loading…
x
Reference in New Issue
Block a user