proxy_cache min/max TTL

Eloy Coto Pereiro ecotoper at redhat.com
Tue Sep 10 15:41:13 UTC 2019


Hi,

Last week I was playing with Nginx proxy caching, and I have the following
questions regarding some changes that I would like to introduce.

At the moment, the cache always uses the `Cache-control: max-age=60` or
other
headers, but there is no way to say in a request that the maximum time is
15seconds for example.

I would like to introduce a new parameter called `proxy_cache_max_ttl`  and
`proxy_cache_min_ttl`  where the  TTL can be defined in a variable and if
the
cache-control is bigger (or smaller) than that will be overwritten. If min
is
set and no header, the cache will be set to this value.

The changes will happen on `ngx_http_upstream_process_header` function, but
I'm
not sure if this change will be accepted.

Do these changes make sense for Nginx? Any reason why these changes will not
accept? Can this be achieved in any other way?

Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20190910/84daba40/attachment.htm>


More information about the nginx-devel mailing list