Hi guys,
I'm wondering if there is a way to achieve this:
I'd like to modify the response from the upstream server before the cache module handles it, preferably using Lua code.
For instance, I'd like to change the Cache-Control header value, which will result in different expiration time in the cache itself.
Or add/remove headers before caching them.
The only method I've found so far, which isn't this efficient, is to use two different locations:
The first does the caching, and fetches from the second location as upstream.
The second location does a plain proxy without caching, and then I can modify anything in the response using the 'header_filter_by_lua_block' directive.
But to do so, I need the first location to proxy_pass from the second location via a real http request, which has its performance penalty (at least I didn't find a way to use an internal location instead).
Is there any other way to do it?
Or are there plans to add a lua hook after getting the response header from the upstream?
Any suggestion will be appreciated!
Thanks in advance,
ShmulikB