From 8644d9491ad3c0eb16bcda1d452aba326e1f4dae Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Thu, 25 May 2017 15:57:59 +0300 Subject: Background subrequests for cache updates. Previously, cache background update might not work as expected, making client wait for it to complete before receiving the final part of a stale response. This could happen if the response could not be sent to the client socket in one filter chain call. Now background cache update is done in a background subrequest. This type of subrequest does not block any other subrequests or the main request. --- src/http/ngx_http_request.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/http/ngx_http_request.h') diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index 98c0de769..283c58294 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -64,6 +64,7 @@ #define NGX_HTTP_SUBREQUEST_IN_MEMORY 2 #define NGX_HTTP_SUBREQUEST_WAITED 4 #define NGX_HTTP_SUBREQUEST_CLONE 8 +#define NGX_HTTP_SUBREQUEST_BACKGROUND 16 #define NGX_HTTP_LOG_UNSAFE 1 @@ -486,7 +487,6 @@ struct ngx_http_request_s { #if (NGX_HTTP_CACHE) unsigned cached:1; - unsigned cache_updater:1; #endif #if (NGX_HTTP_GZIP) @@ -543,6 +543,7 @@ struct ngx_http_request_s { unsigned stat_writing:1; unsigned stat_processing:1; + unsigned background:1; unsigned health_check:1; /* used to parse HTTP headers */ -- cgit