Cache based on custom header

Chad Hansen chadhansen at google.com
Thu Feb 9 19:43:35 UTC 2017


Thanks! What part of openresty supplies that? For instance, it includes
more-set-headers: if I include that, could i rewrite the incoming
cache-related headers before cache layer processes them?

On Wed, Feb 8, 2017 at 7:10 PM Peter Booth <peter_booth at me.com> wrote:

> Yes you can. For some subtle custom cache logic I needed to use openresty,
> which is an nginx bundle that adds a lot of customization points.
>
> Sent from my iPhone
>
> > On Feb 8, 2017, at 5:47 PM, Chad Hansen via nginx <nginx at nginx.org>
> wrote:
> >
> > I use nginx as a reverse proxy, and upstream clients have a need for my
> service to cache differently than downstream servers.
> >
> > Is there a way to change what header nginx uses to accept cache settings?
> > Or a way to re-write cache headers before the cache settings take affect?
> >
> > For example, I could have the upstream server set X-CustomCache
> (intended for my service) and CacheControl (intended for my downstream),
> then use add-header to set X-Accel-Expires to that value, except the header
> re-write happens after the request has been cached from Cache-Control.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20170209/221212c6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4851 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20170209/221212c6/attachment.bin>


More information about the nginx mailing list