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"
|
noStore = "no-store"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ignoreHeaders = map[string]any{
|
var ignoreHeaders = map[string]struct{}{
|
||||||
"Connection": nil,
|
"Connection": {},
|
||||||
"Keep-Alive": nil,
|
"Keep-Alive": {},
|
||||||
"Proxy-Authenticate": nil,
|
"Proxy-Authenticate": {},
|
||||||
"Proxy-Authorization": nil,
|
"Proxy-Authorization": {},
|
||||||
"TE": nil,
|
"TE": {},
|
||||||
"Trailers": nil,
|
"Trailers": {},
|
||||||
"Transfer-Encoding": nil,
|
"Transfer-Encoding": {},
|
||||||
"Upgrade": nil,
|
"Upgrade": {},
|
||||||
"Content-Type": nil, // already stored explicitly by the cache manager
|
"Content-Type": {}, // already stored explicitly by the cache manager
|
||||||
"Content-Encoding": nil, // already stored explicitly by the cache manager
|
"Content-Encoding": {}, // already stored explicitly by the cache manager
|
||||||
}
|
}
|
||||||
|
|
||||||
var cacheableStatusCodes = map[int]bool{
|
var cacheableStatusCodes = map[int]bool{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user