Cache vs expires time

Maxim Dounin mdounin at
Thu Jan 10 13:05:15 UTC 2019


On Thu, Jan 10, 2019 at 10:32:28AM +0200, Andrei wrote:

> Thanks again for the pointers. I have caching enabled, and the purpose of
> this is to set different expire times based on the request (if it's
> cacheable). So I have 3 locations: 1 for frontpage, 1 for dynamic pages and
> another for static content. I can't use your example though because it will
> ignore those headers even for requests which shouldn't be cached, hence the
> $skip_cache variable check. Is there a way to tie checking a variable value
> to the ignore headers method?

Let me re-iterate:

> > Note well that it makes little to no sense to only ignore Expires
> > and Cache-Control on cached requests, since these headers are only
> > used by nginx for caching.  If caching is not used, these headers
> > are ignored anyway.  See
> > for details.

Maxim Dounin

More information about the nginx mailing list