]> git.kaiwu.me - nginx.git/commit
Merging r4151, r4152, r4177:
authorIgor Sysoev <igor@sysoev.ru>
Tue, 1 Nov 2011 13:49:31 +0000 (13:49 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 1 Nov 2011 13:49:31 +0000 (13:49 +0000)
commit4332c96e3853fb0c3eaa3b9e7a3df1a61618056e
treeede815307eed97bbac2c7f1d39df323f789bf1f4
parent1682a70d28b4ff35ea40241c241b9d4ee00faa58
Merging r4151, r4152, r4177:

HTTP cache related fixes:

*) Cache: fix for sending of empty responses.

   Revert wrong fix for empty responses introduced in 0.8.31 and apply new
   one, rewritten to match things done by static module as close as possible.

*) Cache: fix for sending of stale responses.

   For normal cached responses ngx_http_cache_send() sends last buffer and then
   request finalized via ngx_http_finalize_request() call, i.e. everything is
   ok.

   But for stale responses (i.e. when upstream died, but we have something in
   cache) the same ngx_http_cache_send() sends last buffer, but then in
   ngx_http_upstream_finalize_request() another last buffer is send.  This
   causes duplicate final chunk to appear if chunked encoding is used (and
   resulting problems with keepalive connections and so on).

   Fix this by not sending in ngx_http_upstream_finalize_request()
   another last buffer if we know response was from cache.

*) Fixed cache bypass caching of non-cacheable replies (ticket #21).

   If cache was bypassed with proxy_cache_bypass, cache-controlling headers
   (Cache-Control, Expires) wasn't considered and response was cached even
   if it was actually non-cacheable.

   Patch by John Ferlito.
src/http/ngx_http_file_cache.c
src/http/ngx_http_upstream.c