<div dir="ltr"><div style="white-space:pre-wrap;line-height:1.75;font-size:14px"><div style="line-height:1.75">Hello, <span style="font-family:Arial">Maxim and other developers,</span></div><div style="line-height:1.75"><br></div><div style="line-height:1.75">In the latest official release, ngx_http_file_cache_set_header will be called in ngx_http_upstream_send_response to realy set a cached file's valid_sec.</div><div style="line-height:1.75">before calling ngx_http_file_cache_set_header, there will be a chance for user defined modules to change the valid_sec in their header filter hooks,no matter what the value is set by Cache-Control/Expires/X-Accel-Expires previously.</div><div style="line-height:1.75"><br></div><div style="line-height:1.75">And that's reasonable.</div><div style="line-height:1.75"><br></div><div style="line-height:1.75">When a cached file is expired, that logic will work fine too.</div><div style="line-height:1.75"><br></div><div style="line-height:1.75">Inconsistency happens, however, when <a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_revalidate"><span style="color:rgb(0,56,132)">proxy_cache_revalidate</span></a><span style="color:rgb(57,57,57)"> is enabled. when we enable </span><a href="http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_revalidate"><span style="color:rgb(0,56,132)">proxy_cache_revalidate</span></a><span style="color:rgb(57,57,57)">, ngx_http_file_cache_update_header will be called in ngx_http_upstream_test_next. And in ngx_http_upstream_test_next, there is no chance for user defined modules to change the valid_sec finally in their header filter hooks. Because before calling ngx_http_upstream_cache_send in ngx_http_upstream_test_next, valid_sec will be cached firstly, and set to a cached file after calling ngx_http_upstream_cache_send and ngx_http_file_cache_update_header. </span></div><div style="line-height:1.75"><br></div><div style="line-height:1.75"><span style="color:rgb(57,57,57)">If we get valid_sec after ngx_http_upstream_cache_send in ngx_http_upstream_test_next, user defined module's modification of valid_sec will take effect.And the consistency will be kept.</span></div><div style="line-height:1.75"><br></div><div style="line-height:1.75"><span style="color:rgb(57,57,57)">I don't konw if i missed something, so what do you think about this situation?</span></div><div style="line-height:1.75"><span style="color:rgb(57,57,57)">Thanks.</span></div><div style="line-height:1.75"><br></div></div></div>