Mercurial > hg > nginx
comparison src/http/ngx_http_upstream.c @ 2875:6e1941b321b7
proxy_cache_methods and fastcgi_cache_methods
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 19 May 2009 13:27:27 +0000 |
parents | e16e03d62435 |
children | 896db5a09bd2 |
comparison
equal
deleted
inserted
replaced
2874:e16e03d62435 | 2875:6e1941b321b7 |
---|---|
327 { 504, NGX_HTTP_UPSTREAM_FT_HTTP_504 }, | 327 { 504, NGX_HTTP_UPSTREAM_FT_HTTP_504 }, |
328 { 404, NGX_HTTP_UPSTREAM_FT_HTTP_404 }, | 328 { 404, NGX_HTTP_UPSTREAM_FT_HTTP_404 }, |
329 { 0, 0 } | 329 { 0, 0 } |
330 }; | 330 }; |
331 | 331 |
332 | |
333 ngx_conf_bitmask_t ngx_http_upstream_cache_method_mask[] = { | |
334 { ngx_string("GET"), NGX_HTTP_GET}, | |
335 { ngx_string("HEAD"), NGX_HTTP_HEAD }, | |
336 { ngx_string("POST"), NGX_HTTP_POST }, | |
337 { ngx_null_string, 0 } | |
338 }; | |
339 | |
340 | |
332 void | 341 void |
333 ngx_http_upstream_init(ngx_http_request_t *r) | 342 ngx_http_upstream_init(ngx_http_request_t *r) |
334 { | 343 { |
335 ngx_str_t *host; | 344 ngx_str_t *host; |
336 ngx_uint_t i; | 345 ngx_uint_t i; |
530 ngx_http_upstream_cache(ngx_http_request_t *r, ngx_http_upstream_t *u) | 539 ngx_http_upstream_cache(ngx_http_request_t *r, ngx_http_upstream_t *u) |
531 { | 540 { |
532 ngx_int_t rc; | 541 ngx_int_t rc; |
533 ngx_http_cache_t *c; | 542 ngx_http_cache_t *c; |
534 | 543 |
535 if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) { | 544 if (!(r->method & u->conf->cache_methods)) { |
536 return NGX_DECLINED; | 545 return NGX_DECLINED; |
537 } | 546 } |
538 | 547 |
539 if (r->method & NGX_HTTP_HEAD) { | 548 if (r->method & NGX_HTTP_HEAD) { |
540 u->method = ngx_http_core_get_method; | 549 u->method = ngx_http_core_get_method; |