Welcome! Log In Create A New Profile

Advanced

[PATCH] skip apply "ngx_http_upstream_process_accel_expires" when a request responeded by cache

TAKADA Sokichi
June 18, 2020 08:42PM
# HG changeset patch
# User TAKADA Sokichi <takada@jocdn.co.jp>
# Date 1592383243 -32400
# Wed Jun 17 17:40:43 2020 +0900
# Node ID d5bbe3ad1f1491125485786aacc5d219c81801d1
# Parent 8cf31489b479b689b7ff4a9601ce24c914d0394c
skip apply "ngx_http_upstream_process_accel_expires" when a request responeded by cache

"ngx_http_upstream_process_accel_expires" is calculate and set valid_date value when a request respond by a cache, even though it will never use in the response.
This patch to skip unnecessary process.

On the other hands, this has good side effect to can get TRUE valid_date value of the cache file in "header filter" and "log" hook handler.
i.e. I would like to get the TRUE valid_date of cache in header_filter_by_lua or log_by_lua handlers.

diff -r 8cf31489b479 -r d5bbe3ad1f14 src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c Mon Jun 15 17:35:26 2020 -0400
+++ b/src/http/ngx_http_upstream.c Wed Jun 17 17:40:43 2020 +0900
@@ -4776,6 +4776,10 @@
return NGX_OK;
}

+ if (r->cached == 1) {
+ return NGX_OK;
+ }
+
len = h->value.len;
p = h->value.data;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] skip apply "ngx_http_upstream_process_accel_expires" when a request responeded by cache

TAKADA Sokichi 375 June 18, 2020 08:42PM

Re: [PATCH] skip apply "ngx_http_upstream_process_accel_expires" when a request responeded by cache

Maxim Dounin 186 June 21, 2020 05:12PM

Re: [PATCH] skip apply "ngx_http_upstream_process_accel_expires" when a request responeded by cache

Sokichi Takada 165 June 22, 2020 04:10AM

Re: [PATCH] skip apply "ngx_http_upstream_process_accel_expires" when a request responeded by cache

Maxim Dounin 165 June 22, 2020 06:38AM

Re: [PATCH] skip apply "ngx_http_upstream_process_accel_expires" when a request responeded by cache

Sokichi Takada 179 June 24, 2020 07:34AM

Re: [PATCH] skip apply "ngx_http_upstream_process_accel_expires" when a request responeded by cache

Maxim Dounin 137 June 25, 2020 04:58AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 173
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready