proxy_cache_lock allow multiple requests to remote server in some cases

jeeeff nginx-forum at
Fri Feb 5 16:02:31 UTC 2016

Anyone else noticed the same behavior?

I wasn't sure if that kind of behavior was correct, but as I said the lock
works properly and only one request get forwarded to the backend server when
there is no cached item in the cache (that is: the cache is empty), so to me
the behavior should be the same when the cache is being refreshed (I don't
see why it would be different?), but that is not the case... so it looks
like a defect to me.

I also tried to confirm if other cache software do the same thing, such as
varnish, and in theory they have this "waiting queue" which should guarantee
that only one request gets forwarded, but there is a bug right now which
actually makes the thing even worst than Nginx (at least Nginx sends a
If-Modified-Since, but varnish just do a full request for all concurrent
requests, their bug tracking ticket is The workaround mentioned
does no even provide the same behavior (it hits the old cache instead of
waiting the queued request), so does not work for me.

Sorry for mentioning about a third party product such as varnish on this
forum, but since I wasn't receiving any response, I wanted to see if other
solutions had this functionality (and confirm my post made sense...), but
then I am now back with Nginx as it works better (and is easier to use)
anyway, at least until the bug is resolved on varnish. If this issue is
resolved on nginx, that would be even better for me... nginx is more
flexible and easier to use.

Posted at Nginx Forum:,264203,264383#msg-264383

More information about the nginx mailing list