3 ms·
> With `Vary`, there could be many entries matching any cache key I'm curious. Why can't the headers listed in the `Vary` header just be made part of the cache
by byroot 8y ago
> With `Vary`, there could be many entries matching any cache key
I'm curious. Why can't the headers listed in the `Vary` header just be made part of the cache key?
- kentonv 8y agoBecause `Vary` is part of the response, not the request. So to find out which headers are listed in `Vary`, you have to look up the response. To look up the response, you need the cache key. So the cache key cannot depend on `Vary`.
- tedunangst 8y agoThis just means when you look up the response in the cache, it returns not a single response but a set organized by Vary header and you pick the right one. It's not impossible.
- kentonv 8y agoYes that's what I said: > You either have to do a linear scan of all entries for that URL, or you need to maintain some sort of fancy index
- byroot 8y agoOh right. I was only thinking of revalidated requests. Thanks.