proxy_cache min/max TTL

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


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
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
cache-control is bigger (or smaller) than that will be overwritten. If min
set and no header, the cache will be set to this value.

The changes will happen on `ngx_http_upstream_process_header` function, but
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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx-devel mailing list