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

Maxim Dounin mdounin at mdounin.ru
Tue Dec 23 03:03:16 UTC 2014


On Mon, Dec 22, 2014 at 05:46:53PM -0800, Piotr Sikora wrote:

> Hey Maxim,
> > 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.
> It will be updated in both cases:
> - in (a) it will use the "Cache-Control" from 304 response,
> - in (b) it will use the "Cache-Control" from cached response.

It won't, as in case (b) the condition "(u->cacheable || valid)" 
in your patch evaluates to false.  Note that the cached response is 
not cacheable now due to Set-Cookie.

Maxim Dounin

More information about the nginx-devel mailing list