# HG changeset patch # User Igor Sysoev # Date 1279106145 0 # Node ID 045ea40cbfe883be50dedb933297a57dc8d6626e # Parent 55f95e91daed7a230f6c5565454851627fdc77ac use ngx_http_test_predicates(), ngx_http_set_predicate_slot() delete ngx_http_cache(), ngx_http_no_cache_set_slot() diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c --- a/src/http/modules/ngx_http_fastcgi_module.c +++ b/src/http/modules/ngx_http_fastcgi_module.c @@ -332,7 +332,7 @@ static ngx_command_t ngx_http_fastcgi_c { ngx_string("fastcgi_no_cache"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_http_no_cache_set_slot, + ngx_http_set_predicate_slot, NGX_HTTP_LOC_CONF_OFFSET, offsetof(ngx_http_fastcgi_loc_conf_t, upstream.no_cache), NULL }, diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c --- a/src/http/modules/ngx_http_proxy_module.c +++ b/src/http/modules/ngx_http_proxy_module.c @@ -341,7 +341,7 @@ static ngx_command_t ngx_http_proxy_com { ngx_string("proxy_no_cache"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_http_no_cache_set_slot, + ngx_http_set_predicate_slot, NGX_HTTP_LOC_CONF_OFFSET, offsetof(ngx_http_proxy_loc_conf_t, upstream.no_cache), NULL }, diff --git a/src/http/modules/ngx_http_scgi_module.c b/src/http/modules/ngx_http_scgi_module.c --- a/src/http/modules/ngx_http_scgi_module.c +++ b/src/http/modules/ngx_http_scgi_module.c @@ -198,7 +198,7 @@ static ngx_command_t ngx_http_scgi_comma { ngx_string("scgi_no_cache"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_http_no_cache_set_slot, + ngx_http_set_predicate_slot, NGX_HTTP_LOC_CONF_OFFSET, offsetof(ngx_http_scgi_loc_conf_t, upstream.no_cache), NULL }, diff --git a/src/http/modules/ngx_http_uwsgi_module.c b/src/http/modules/ngx_http_uwsgi_module.c --- a/src/http/modules/ngx_http_uwsgi_module.c +++ b/src/http/modules/ngx_http_uwsgi_module.c @@ -225,7 +225,7 @@ static ngx_command_t ngx_http_uwsgi_comm { ngx_string("uwsgi_no_cache"), NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, - ngx_http_no_cache_set_slot, + ngx_http_set_predicate_slot, NGX_HTTP_LOC_CONF_OFFSET, offsetof(ngx_http_uwsgi_loc_conf_t, upstream.no_cache), NULL }, diff --git a/src/http/ngx_http_cache.h b/src/http/ngx_http_cache.h --- a/src/http/ngx_http_cache.h +++ b/src/http/ngx_http_cache.h @@ -134,10 +134,6 @@ char *ngx_http_file_cache_set_slot(ngx_c char *ngx_http_file_cache_valid_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); -ngx_int_t ngx_http_cache(ngx_http_request_t *r, ngx_array_t *no_cache); -char *ngx_http_no_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); - extern ngx_str_t ngx_http_cache_status[]; 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 @@ -633,11 +633,9 @@ ngx_http_upstream_cache(ngx_http_request if (c == NULL) { - if (u->conf->no_cache) { - rc = ngx_http_cache(r, u->conf->no_cache); - if (rc != NGX_OK) { - return rc; - } + rc = ngx_http_test_predicates(r, u->conf->no_cache); + if (rc != NGX_OK) { + return rc; } if (!(r->method & u->conf->cache_methods)) {