2

I see the proxy_cache_valid directive, but that confuses me.

In HTTP, doesn't the upstream server specify this with Cache-Control and maxage?

How do I get Nginx's cache to use maxage ?

1 Answer 1

1

It's clearly explained in the documentation of proxy_cache_valid directive.

Parameters of caching can also be set directly in the response header. This has higher priority than setting of caching time using the directive. The “X-Accel-Expires” header field sets caching time of a response in seconds. The zero value disables caching for a response. If the value starts with the @ prefix, it sets an absolute time in seconds since Epoch, up to which the response may be cached. If the header does not include the “X-Accel-Expires” field, parameters of caching may be set in the header fields “Expires” or “Cache-Control”. If the header includes the “Set-Cookie” field, such a response will not be cached. Processing of one or more of these response header fields can be disabled using the proxy_ignore_headers directive.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .