mirror of
https://github.com/nginx/nginx.git
synced 2024-12-03 04:39:00 +08:00
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:
parent
7fc29052e8
commit
f3870c66df
@ -332,7 +332,7 @@ static ngx_command_t ngx_http_fastcgi_commands[] = {
|
|||||||
|
|
||||||
{ ngx_string("fastcgi_no_cache"),
|
{ ngx_string("fastcgi_no_cache"),
|
||||||
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
|
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,
|
NGX_HTTP_LOC_CONF_OFFSET,
|
||||||
offsetof(ngx_http_fastcgi_loc_conf_t, upstream.no_cache),
|
offsetof(ngx_http_fastcgi_loc_conf_t, upstream.no_cache),
|
||||||
NULL },
|
NULL },
|
||||||
|
@ -341,7 +341,7 @@ static ngx_command_t ngx_http_proxy_commands[] = {
|
|||||||
|
|
||||||
{ ngx_string("proxy_no_cache"),
|
{ ngx_string("proxy_no_cache"),
|
||||||
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
|
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,
|
NGX_HTTP_LOC_CONF_OFFSET,
|
||||||
offsetof(ngx_http_proxy_loc_conf_t, upstream.no_cache),
|
offsetof(ngx_http_proxy_loc_conf_t, upstream.no_cache),
|
||||||
NULL },
|
NULL },
|
||||||
|
@ -198,7 +198,7 @@ static ngx_command_t ngx_http_scgi_commands[] = {
|
|||||||
|
|
||||||
{ ngx_string("scgi_no_cache"),
|
{ ngx_string("scgi_no_cache"),
|
||||||
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
|
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,
|
NGX_HTTP_LOC_CONF_OFFSET,
|
||||||
offsetof(ngx_http_scgi_loc_conf_t, upstream.no_cache),
|
offsetof(ngx_http_scgi_loc_conf_t, upstream.no_cache),
|
||||||
NULL },
|
NULL },
|
||||||
|
@ -225,7 +225,7 @@ static ngx_command_t ngx_http_uwsgi_commands[] = {
|
|||||||
|
|
||||||
{ ngx_string("uwsgi_no_cache"),
|
{ ngx_string("uwsgi_no_cache"),
|
||||||
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
|
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,
|
NGX_HTTP_LOC_CONF_OFFSET,
|
||||||
offsetof(ngx_http_uwsgi_loc_conf_t, upstream.no_cache),
|
offsetof(ngx_http_uwsgi_loc_conf_t, upstream.no_cache),
|
||||||
NULL },
|
NULL },
|
||||||
|
@ -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,
|
char *ngx_http_file_cache_valid_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
|
||||||
void *conf);
|
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[];
|
extern ngx_str_t ngx_http_cache_status[];
|
||||||
|
|
||||||
|
@ -633,11 +633,9 @@ ngx_http_upstream_cache(ngx_http_request_t *r, ngx_http_upstream_t *u)
|
|||||||
|
|
||||||
if (c == NULL) {
|
if (c == NULL) {
|
||||||
|
|
||||||
if (u->conf->no_cache) {
|
rc = ngx_http_test_predicates(r, u->conf->no_cache);
|
||||||
rc = ngx_http_cache(r, u->conf->no_cache);
|
if (rc != NGX_OK) {
|
||||||
if (rc != NGX_OK) {
|
return rc;
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(r->method & u->conf->cache_methods)) {
|
if (!(r->method & u->conf->cache_methods)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user