[PATCH 2 of 2] Cache: test proxy_no_cache predicates before updating cache

Piotr Sikora piotr at cloudflare.com
Wed Dec 17 01:31:25 UTC 2014

Hey Maxim,

> Again, not sure it's a good change.  In particular, suggested code
> checks proxy_no_cache against a 304 response, not against a
> response which will be cached (or, rather, already cached), and
> this looks very questionable.

Rather, it checks whether it can extend the validity of the cached
response based on the 304 response, which is used exactly for that

While I agree that this isn't perfect, because 304 response doesn't
contain all headers that proxy_no_cache might want to check, I think
it's much better than totally ignoring that directive, which is the
case now... At the very least, it checks client headers, which are
perfect candidates for proxy_bypass and proxy_no_cache.

Would checking proxy_no_cache against both 304 and cached response
work for you or are you totally against this idea?

Best regards,
Piotr Sikora

More information about the nginx-devel mailing list