[PATCH 1 of 2] Cache: don't update cache if revalidated response is not cacheable

Maxim Dounin mdounin at mdounin.ru
Tue Dec 23 01:28:40 UTC 2014


On Mon, Dec 22, 2014 at 05:02:32PM -0800, Piotr Sikora wrote:

> > But even if you assume they are not equivalent (that is, (b) final
> > response shouldn't have "Cache-Control: max-age=100") in case of (b)
> > validity should be extended as if there are no Cache-Control
> > headers in the response, i.e., per proxy_cache_valid.  This is not what
> > happens with your patch, so the problem is here anyway.
> Ironically, with the patch I sent, the cache will be updated according
> to headers from cached response if there is nothing in 304 response
> that sets the validity, which makes (a) and (b) equivalent... And as
> far as I can tell, this matches the current behavior, so I'm not
> really sure what's the problem you're talking about.

With the patch you've sent the response will not be updated in 
case (b), but will be updated in case (a).  And this difference is 
the problem.

Maxim Dounin

More information about the nginx-devel mailing list