From def37d254aa4f9523b7bf82b1d26530e0b216842 Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Sat, 4 Jan 2014 03:32:10 +0400 Subject: [PATCH] Upstream: Cache-Control preferred over Expires. Not really a strict check (as X-Accel-Expires might be ignored or contain invalid value), but quite simple to implement and better than what we have now. --- src/http/ngx_http_upstream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index 8c436b3ca..b6504d325 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -3656,7 +3656,7 @@ ngx_http_upstream_process_cache_control(ngx_http_request_t *r, return NGX_OK; } - if (r->cache->valid_sec != 0) { + if (r->cache->valid_sec != 0 && u->headers_in.x_accel_expires != NULL) { return NGX_OK; }