comparison src/http/modules/ngx_http_proxy_module.c @ 588:b6a5942a4e6a NGINX_0_8_46

nginx 0.8.46 *) Change: now the "proxy_no_cache", "fastcgi_no_cache", "uwsgi_no_cache", and "scgi_no_cache" directives affect on a cached response saving only. *) Feature: the "proxy_cache_bypass", "fastcgi_cache_bypass", "uwsgi_cache_bypass", and "scgi_cache_bypass" directives. *) Bugfix: nginx did not free memory in cache keys zones if there was an error during working with backend: the memory was freed only after inactivity time or on memory low condition.
author Igor Sysoev <http://sysoev.ru>
date Mon, 19 Jul 2010 00:00:00 +0400
parents 016632f0fb18
children 09d5f308901f
comparison
equal deleted inserted replaced
587:913af46ee783 588:b6a5942a4e6a
337 ngx_http_file_cache_set_slot, 337 ngx_http_file_cache_set_slot,
338 0, 338 0,
339 0, 339 0,
340 &ngx_http_proxy_module }, 340 &ngx_http_proxy_module },
341 341
342 { ngx_string("proxy_cache_bypass"),
343 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
344 ngx_http_set_predicate_slot,
345 NGX_HTTP_LOC_CONF_OFFSET,
346 offsetof(ngx_http_proxy_loc_conf_t, upstream.cache_bypass),
347 NULL },
348
342 { ngx_string("proxy_no_cache"), 349 { ngx_string("proxy_no_cache"),
343 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE, 350 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
344 ngx_http_no_cache_set_slot, 351 ngx_http_set_predicate_slot,
345 NGX_HTTP_LOC_CONF_OFFSET, 352 NGX_HTTP_LOC_CONF_OFFSET,
346 offsetof(ngx_http_proxy_loc_conf_t, upstream.no_cache), 353 offsetof(ngx_http_proxy_loc_conf_t, upstream.no_cache),
347 NULL }, 354 NULL },
348 355
349 { ngx_string("proxy_cache_valid"), 356 { ngx_string("proxy_cache_valid"),
1676 conf->upstream.pass_request_body = NGX_CONF_UNSET; 1683 conf->upstream.pass_request_body = NGX_CONF_UNSET;
1677 1684
1678 #if (NGX_HTTP_CACHE) 1685 #if (NGX_HTTP_CACHE)
1679 conf->upstream.cache = NGX_CONF_UNSET_PTR; 1686 conf->upstream.cache = NGX_CONF_UNSET_PTR;
1680 conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT; 1687 conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;
1688 conf->upstream.cache_bypass = NGX_CONF_UNSET_PTR;
1681 conf->upstream.no_cache = NGX_CONF_UNSET_PTR; 1689 conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
1682 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR; 1690 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
1683 #endif 1691 #endif
1684 1692
1685 conf->upstream.hide_headers = NGX_CONF_UNSET_PTR; 1693 conf->upstream.hide_headers = NGX_CONF_UNSET_PTR;
1900 if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) { 1908 if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) {
1901 conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET 1909 conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET
1902 |NGX_HTTP_UPSTREAM_FT_OFF; 1910 |NGX_HTTP_UPSTREAM_FT_OFF;
1903 } 1911 }
1904 1912
1913 ngx_conf_merge_ptr_value(conf->upstream.cache_bypass,
1914 prev->upstream.cache_bypass, NULL);
1915
1905 ngx_conf_merge_ptr_value(conf->upstream.no_cache, 1916 ngx_conf_merge_ptr_value(conf->upstream.no_cache,
1906 prev->upstream.no_cache, NULL); 1917 prev->upstream.no_cache, NULL);
1918
1919 if (conf->upstream.no_cache && conf->upstream.cache_bypass == NULL) {
1920 ngx_log_error(NGX_LOG_WARN, cf->log, 0,
1921 "\"proxy_no_cache\" functionality has been changed in 0.8.46, "
1922 "now it should be used together with \"proxy_cache_bypass\"");
1923 }
1907 1924
1908 ngx_conf_merge_ptr_value(conf->upstream.cache_valid, 1925 ngx_conf_merge_ptr_value(conf->upstream.cache_valid,
1909 prev->upstream.cache_valid, NULL); 1926 prev->upstream.cache_valid, NULL);
1910 1927
1911 if (conf->cache_key.value.data == NULL) { 1928 if (conf->cache_key.value.data == NULL) {