gojek/wrest

Caching support for Vary header

jeremyshearer opened this issue · 1 comments

I'm using Wrest to interact with a service that sets a Vary header for "Accept-Encoding" and so none of my responses are being cached

I'm looking at adding support for caching a GET request that includes a Vary header.

At a glance it looks somewhat straightforward. My initial thought is

  • Replace the check in cacheable? to only return false if the Vary header is set to "*"
  • Update the hash method on the get request to look for the Vary header and incorporate the values of any headers listed there so they are included in the cache key.

Does that sound reasonable? If I'm missing any big pieces please let me know.

included
refer: a63f8d0