[PATCH] Upstream: avoid closing connection when no client body needed
jli.justinli at gmail.com
Wed Mar 9 01:56:11 UTC 2016
Thanks for your feedback Maxim!
On Wed, Mar 09, 2016 at 01:13:46, Maxim Dounin wrote:
> So you are trying to optimize a specific case with proxy_no_cache
> in addition to what 35990c69b3ac fixed, right?
Yes, as you figured, this is about preventing the client connection from
closed when the client response is header_only and the upstream response
switches from cacheable to not cacheable between the header_only check
and downstream_error check. Sorry for the vagueness.
> What about explicitly handling the proxy_no_cache case right
> after the proxy_no_cache cache check, much like it is already done
> with cache object (see ngx_http_file_cache_free() call)?
> (Additionally, the code between the no_cache test and the
> ngx_http_file_cache_free() call also shows that lack of
> proxy_cache_valid and/or explicit cache validity headers can lead
> to the same behaviour.)
I assume you mean something like calling
if (r->header_only && !u->cacheable && !u->store) after the referenced call
ngx_http_file_cache_free(). I'll submit another patch after testing to
fully fixes our issue unless you object to that interpretation.
Developer @ Shopify
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx-devel