Mercurial > hg > nginx
changeset 5950:eaeecf00d5d7
Upstream: preset some cache configuration when bypassing.
No functional changes.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Mon, 22 Dec 2014 12:59:06 +0300 |
parents | 634da79665d3 |
children | 610832763648 |
files | src/http/ngx_http_upstream.c |
diffstat | 1 files changed, 7 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c Mon Dec 22 12:59:02 2014 +0300 +++ b/src/http/ngx_http_upstream.c Mon Dec 22 12:59:06 2014 +0300 @@ -763,6 +763,12 @@ u->cacheable = 1; + c = r->cache; + + c->body_start = u->conf->buffer_size; + c->min_uses = u->conf->cache_min_uses; + c->file_cache = u->conf->cache_zone->data; + switch (ngx_http_test_predicates(r, u->conf->cache_bypass)) { case NGX_ERROR: @@ -776,12 +782,6 @@ break; } - c = r->cache; - - c->min_uses = u->conf->cache_min_uses; - c->body_start = u->conf->buffer_size; - c->file_cache = u->conf->cache_zone->data; - c->lock = u->conf->cache_lock; c->lock_timeout = u->conf->cache_lock_timeout; c->lock_age = u->conf->cache_lock_age; @@ -2536,9 +2536,7 @@ if (u->cache_status == NGX_HTTP_CACHE_BYPASS) { - r->cache->min_uses = u->conf->cache_min_uses; - r->cache->body_start = u->conf->buffer_size; - r->cache->file_cache = u->conf->cache_zone->data; + /* create cache if previously bypassed */ if (ngx_http_file_cache_create(r) != NGX_OK) { ngx_http_upstream_finalize_request(r, u, NGX_ERROR);