Mercurial > hg > nginx
comparison src/http/ngx_http_request.h @ 7006:9552758a786e
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.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Thu, 25 May 2017 15:57:59 +0300 |
parents | 8801ff7d58e1 |
children | 1b068a4e82d8 |
comparison
equal
deleted
inserted
replaced
7005:3e2d90073adf | 7006:9552758a786e |
---|---|
62 | 62 |
63 /* unused 1 */ | 63 /* unused 1 */ |
64 #define NGX_HTTP_SUBREQUEST_IN_MEMORY 2 | 64 #define NGX_HTTP_SUBREQUEST_IN_MEMORY 2 |
65 #define NGX_HTTP_SUBREQUEST_WAITED 4 | 65 #define NGX_HTTP_SUBREQUEST_WAITED 4 |
66 #define NGX_HTTP_SUBREQUEST_CLONE 8 | 66 #define NGX_HTTP_SUBREQUEST_CLONE 8 |
67 #define NGX_HTTP_SUBREQUEST_BACKGROUND 16 | |
67 | 68 |
68 #define NGX_HTTP_LOG_UNSAFE 1 | 69 #define NGX_HTTP_LOG_UNSAFE 1 |
69 | 70 |
70 | 71 |
71 #define NGX_HTTP_CONTINUE 100 | 72 #define NGX_HTTP_CONTINUE 100 |
484 unsigned subrequest_in_memory:1; | 485 unsigned subrequest_in_memory:1; |
485 unsigned waited:1; | 486 unsigned waited:1; |
486 | 487 |
487 #if (NGX_HTTP_CACHE) | 488 #if (NGX_HTTP_CACHE) |
488 unsigned cached:1; | 489 unsigned cached:1; |
489 unsigned cache_updater:1; | |
490 #endif | 490 #endif |
491 | 491 |
492 #if (NGX_HTTP_GZIP) | 492 #if (NGX_HTTP_GZIP) |
493 unsigned gzip_tested:1; | 493 unsigned gzip_tested:1; |
494 unsigned gzip_ok:1; | 494 unsigned gzip_ok:1; |
541 unsigned disable_not_modified:1; | 541 unsigned disable_not_modified:1; |
542 unsigned stat_reading:1; | 542 unsigned stat_reading:1; |
543 unsigned stat_writing:1; | 543 unsigned stat_writing:1; |
544 unsigned stat_processing:1; | 544 unsigned stat_processing:1; |
545 | 545 |
546 unsigned background:1; | |
546 unsigned health_check:1; | 547 unsigned health_check:1; |
547 | 548 |
548 /* used to parse HTTP headers */ | 549 /* used to parse HTTP headers */ |
549 | 550 |
550 ngx_uint_t state; | 551 ngx_uint_t state; |