You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Vary header can change the cacheability of a response. This library could add some helpers to account for it. A dev would probably want to create a cache key based on the headers in Vary
Proposal:
Add additional return value to CachableResponse of []string that is the list of headers in the Vary header. E.g. ["Accept-Language", "Accept-Encoding"]
Add helper to extract headers from a http.Request based on the Vary list
This would be a great pull request, and I like how the proposal is split into 3 separate isolated changes.
I assume for #1 you would use the normalization function right? Just thinking out loud - Does it make sense to have a "type" for the normalized vary header to avoid extra parsing in #2? String might be fine enough.
Is there a 4th function here, a "cache keys" function, that could return a map[string]string of cache keys or a similar interface? (i think actually hashing the keys should be done outside of this library - many different ways people might want to do that)
The
Vary
header can change the cacheability of a response. This library could add some helpers to account for it. A dev would probably want to create a cache key based on the headers inVary
Proposal:
CachableResponse
of[]string
that is the list of headers in theVary
header. E.g.["Accept-Language", "Accept-Encoding"]
http.Request
based on theVary
listThe text was updated successfully, but these errors were encountered: