comparison src/http/modules/ngx_http_uwsgi_module.c @ 5905:2f7e557eab5b

Cache: proxy_cache_lock_age and friends. Once this age is reached, the cache lock is discarded and another request can acquire the lock. Requests which failed to acquire the lock are not allowed to cache the response.
author Roman Arutyunyan <arut@nginx.com>
date Tue, 18 Nov 2014 20:41:12 +0300
parents 20d966ad5e89
children 195561ef367f
comparison
equal deleted inserted replaced
5904:abb466a57a22 5905:2f7e557eab5b
332 { ngx_string("uwsgi_cache_lock_timeout"), 332 { ngx_string("uwsgi_cache_lock_timeout"),
333 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, 333 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
334 ngx_conf_set_msec_slot, 334 ngx_conf_set_msec_slot,
335 NGX_HTTP_LOC_CONF_OFFSET, 335 NGX_HTTP_LOC_CONF_OFFSET,
336 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_lock_timeout), 336 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_lock_timeout),
337 NULL },
338
339 { ngx_string("uwsgi_cache_lock_age"),
340 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
341 ngx_conf_set_msec_slot,
342 NGX_HTTP_LOC_CONF_OFFSET,
343 offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_lock_age),
337 NULL }, 344 NULL },
338 345
339 { ngx_string("uwsgi_cache_revalidate"), 346 { ngx_string("uwsgi_cache_revalidate"),
340 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, 347 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
341 ngx_conf_set_flag_slot, 348 ngx_conf_set_flag_slot,
1337 conf->upstream.cache_bypass = NGX_CONF_UNSET_PTR; 1344 conf->upstream.cache_bypass = NGX_CONF_UNSET_PTR;
1338 conf->upstream.no_cache = NGX_CONF_UNSET_PTR; 1345 conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
1339 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR; 1346 conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
1340 conf->upstream.cache_lock = NGX_CONF_UNSET; 1347 conf->upstream.cache_lock = NGX_CONF_UNSET;
1341 conf->upstream.cache_lock_timeout = NGX_CONF_UNSET_MSEC; 1348 conf->upstream.cache_lock_timeout = NGX_CONF_UNSET_MSEC;
1349 conf->upstream.cache_lock_age = NGX_CONF_UNSET_MSEC;
1342 conf->upstream.cache_revalidate = NGX_CONF_UNSET; 1350 conf->upstream.cache_revalidate = NGX_CONF_UNSET;
1343 #endif 1351 #endif
1344 1352
1345 conf->upstream.hide_headers = NGX_CONF_UNSET_PTR; 1353 conf->upstream.hide_headers = NGX_CONF_UNSET_PTR;
1346 conf->upstream.pass_headers = NGX_CONF_UNSET_PTR; 1354 conf->upstream.pass_headers = NGX_CONF_UNSET_PTR;
1603 ngx_conf_merge_value(conf->upstream.cache_lock, 1611 ngx_conf_merge_value(conf->upstream.cache_lock,
1604 prev->upstream.cache_lock, 0); 1612 prev->upstream.cache_lock, 0);
1605 1613
1606 ngx_conf_merge_msec_value(conf->upstream.cache_lock_timeout, 1614 ngx_conf_merge_msec_value(conf->upstream.cache_lock_timeout,
1607 prev->upstream.cache_lock_timeout, 5000); 1615 prev->upstream.cache_lock_timeout, 5000);
1616
1617 ngx_conf_merge_msec_value(conf->upstream.cache_lock_age,
1618 prev->upstream.cache_lock_age, 5000);
1608 1619
1609 ngx_conf_merge_value(conf->upstream.cache_revalidate, 1620 ngx_conf_merge_value(conf->upstream.cache_revalidate,
1610 prev->upstream.cache_revalidate, 0); 1621 prev->upstream.cache_revalidate, 0);
1611 1622
1612 #endif 1623 #endif