use ngx_http_test_predicates(), ngx_http_set_predicate_slot()

delete ngx_http_cache(), ngx_http_no_cache_set_slot()
This commit is contained in:
Igor Sysoev 2010-07-14 11:15:45 +00:00
parent 7fc29052e8
commit f3870c66df
6 changed files with 7 additions and 13 deletions

View File

@ -332,7 +332,7 @@ static ngx_command_t ngx_http_fastcgi_commands[] = {
{ 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 },

View File

@ -341,7 +341,7 @@ static ngx_command_t ngx_http_proxy_commands[] = {
{ 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 },

View File

@ -198,7 +198,7 @@ static ngx_command_t ngx_http_scgi_commands[] = {
{ 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 },

View File

@ -225,7 +225,7 @@ static ngx_command_t ngx_http_uwsgi_commands[] = {
{ 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 },

View File

@ -134,10 +134,6 @@ char *ngx_http_file_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
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[];

View File

@ -633,11 +633,9 @@ ngx_http_upstream_cache(ngx_http_request_t *r, ngx_http_upstream_t *u)
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)) {