openresty / srcache-nginx-module

Transparent subrequest-based caching layout for arbitrary nginx locations.
http://wiki.nginx.org/NginxHttpSRCacheModule
476 stars 105 forks source link

compute a $storeKey for srcache_store after upstream response ? #52

Closed kapouer closed 8 years ago

kapouer commented 8 years ago

Hi, i'm trying to implement HTTP Vary with srcache. A typical upstream response will contain a Vary: Accept-Language field, header_filter_by_lua_block could then

  1. compute a $storeKey by concatenation of key/value of request fields listed in that Vary header
  2. store url => Vary field in a shared dict (Upon later request, set_by_lua_block could compute a $requestKey by looking up in the shared dict to get the list of Vary headers for the requested url.)

Question: is it possible to make srcache_store use $storeKey and not preprocessed key ?

agentzh commented 8 years ago

@kapouer I think so.

kapouer commented 8 years ago

Got it !