[PATCH 15 of 15] Use cache status UPDATING when serving from tempfile

Jiří Setnička jiri.setnicka at cdn77.com
Fri Jan 28 16:32:07 UTC 2022


# HG changeset patch
# User Jiří Setnička  <jiri.setnicka at cdn77.com>
# Date 1643385660 -3600
#      Fri Jan 28 17:01:00 2022 +0100
# Node ID 6745b619f44ea7debddfe04d9af37d1deffe89dd
# Parent  3cd1f04d933137153b0628819ccb251d1f57614b
Use cache status UPDATING when serving from tempfile

diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -954,7 +954,11 @@ ngx_http_upstream_cache(ngx_http_request
         break;
 
     case NGX_OK:
-        u->cache_status = NGX_HTTP_CACHE_HIT;
+        if (c->tf_node != NULL) {
+            u->cache_status = NGX_HTTP_CACHE_UPDATING;
+        } else {
+            u->cache_status = NGX_HTTP_CACHE_HIT;
+        }
     }
 
     switch (rc) {


More information about the nginx-devel mailing list