# HG changeset patch # User Maxim Dounin # Date 1388791930 -14400 # Node ID 6a3ab6fdd70f9c57e51cc0e1ee2b1cfff2d39e7e # Parent b91bcba2935185ad1e0c2568b8d4450c5b94b9f2 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. 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 @@ -3656,7 +3656,7 @@ ngx_http_upstream_process_cache_control( 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; }