comparison src/http/modules/ngx_http_proxy_module.c @ 3597:0d8b8c84bab7 stable-0.7

merge r3518, r3527: cache related fixes: *) do not cache response if it has "no-store" or "private" in "Cache-Control" header *) proxy_no_cache and fastcgi_no_cache
author Igor Sysoev <igor@sysoev.ru>
date Mon, 07 Jun 2010 12:23:23 +0000
parents 1c2e8b92751d
children
comparison
equal deleted inserted replaced
3596:555de5bdb800 3597:0d8b8c84bab7
354 NGX_HTTP_MAIN_CONF|NGX_CONF_2MORE, 354 NGX_HTTP_MAIN_CONF|NGX_CONF_2MORE,
355 ngx_http_file_cache_set_slot, 355 ngx_http_file_cache_set_slot,
356 0, 356 0,
357 0, 357 0,
358 &ngx_http_proxy_module }, 358 &ngx_http_proxy_module },
359
360 { ngx_string("proxy_no_cache"),
361 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
362 ngx_http_no_cache_set_slot,
363 NGX_HTTP_LOC_CONF_OFFSET,
364 offsetof(ngx_http_proxy_loc_conf_t, upstream.no_cache),
365 NULL },
359 366
360 { ngx_string("proxy_cache_valid"), 367 { ngx_string("proxy_cache_valid"),
361 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, 368 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
362 ngx_http_file_cache_valid_set_slot, 369 ngx_http_file_cache_valid_set_slot,
363 NGX_HTTP_LOC_CONF_OFFSET, 370 NGX_HTTP_LOC_CONF_OFFSET,
1931 conf->upstream.pass_request_body = NGX_CONF_UNSET; 1938 conf->upstream.pass_request_body = NGX_CONF_UNSET;
1932 1939
1933 #if (NGX_HTTP_CACHE) 1940 #if (NGX_HTTP_CACHE)
1934 conf->upstream.cache = NGX_CONF_UNSET_PTR; 1941 conf->upstream.cache = NGX_CONF_UNSET_PTR;
1935 conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT; 1942 conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;
1943 conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
1936 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR; 1944 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
1937 #endif 1945 #endif
1938 1946
1939 conf->upstream.hide_headers = NGX_CONF_UNSET_PTR; 1947 conf->upstream.hide_headers = NGX_CONF_UNSET_PTR;
1940 conf->upstream.pass_headers = NGX_CONF_UNSET_PTR; 1948 conf->upstream.pass_headers = NGX_CONF_UNSET_PTR;
2154 2162
2155 if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) { 2163 if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) {
2156 conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET 2164 conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET
2157 |NGX_HTTP_UPSTREAM_FT_OFF; 2165 |NGX_HTTP_UPSTREAM_FT_OFF;
2158 } 2166 }
2167
2168 ngx_conf_merge_ptr_value(conf->upstream.no_cache,
2169 prev->upstream.no_cache, NULL);
2159 2170
2160 ngx_conf_merge_ptr_value(conf->upstream.cache_valid, 2171 ngx_conf_merge_ptr_value(conf->upstream.cache_valid,
2161 prev->upstream.cache_valid, NULL); 2172 prev->upstream.cache_valid, NULL);
2162 2173
2163 if (conf->cache_key.value.data == NULL) { 2174 if (conf->cache_key.value.data == NULL) {