uwsgi_connect_timeout

Syntax: uwsgi_connect_timeout time; Default: uwsgi_connect_timeout 60s; Context: http, server, location Defines a timeout for establishing a connection with a uwsgi server. It should be noted that this timeout cannot usually exceed 75 seconds.

uwsgi_cache_valid

Syntax: uwsgi_cache_valid [code ...] time; Default: — Context: http, server, location Sets caching time for different response codes. For example, the following directives uwsgi_cache_valid 200 302 10m; uwsgi_cache_valid 404 1m; set 10 minutes of caching for responses with codes 200 and 302 and 1 minute for responses with code 404. If only caching time is specified uwsgi_cache_valid 5m; then only 200, 301, and 302 responses are cached. In addition, the any paramete

uwsgi_cache_use_stale

Syntax: uwsgi_cache_use_stale error | timeout | invalid_header | updating | http_500 | http_503 | http_403 | http_404 | off ...; Default: uwsgi_cache_use_stale off; Context: http, server, location Determines in which cases a stale cached response can be used when an error occurs during communication with the uwsgi server. The directive’s parameters match the parameters of the uwsgi_next_upstream directive. The error parameter also permits

uwsgi_cache_revalidate

Syntax: uwsgi_cache_revalidate on | off; Default: uwsgi_cache_revalidate off; Context: http, server, location This directive appeared in version 1.5.7. Enables revalidation of expired cache items using conditional requests with the “If-Modified-Since” and “If-None-Match” header fields.

uwsgi_cache_purge

Syntax: uwsgi_cache_purge string ...; Default: — Context: http, server, location This directive appeared in version 1.5.7. Defines conditions under which the request will be considered a cache purge request. If at least one value of the string parameters is not empty and is not equal to “0” then the cache entry with a corresponding cache key is removed. The result of successful operation is indicated by returning the 204 (No Content) response. If the cache key of a purge request

uwsgi_cache_path

Syntax: uwsgi_cache_path path [levels=levels] [use_temp_path=on|off] keys_zone=name:size [inactive=time] [max_size=size] [manager_files=number] [manager_sleep=time] [manager_threshold=time] [loader_files=number] [loader_sleep=time] [loader_threshold=time] [purger=on|off] [purger_files=number] [purger_sleep=time] [purger_threshold=time]; Default: — Context: http Sets the path and other parameters of a cache. Cache data

uwsgi_cache_min_uses

Syntax: uwsgi_cache_min_uses number; Default: uwsgi_cache_min_uses 1; Context: http, server, location Sets the number of requests after which the response will be cached.

uwsgi_cache_methods

Syntax: uwsgi_cache_methods GET | HEAD | POST ...; Default: uwsgi_cache_methods GET HEAD; Context: http, server, location If the client request method is listed in this directive then the response will be cached. “GET” and “HEAD” methods are always added to the list, though it is recommended to specify them explicitly. See also the uwsgi_no_cache directive.

uwsgi_cache_max_range_offset

Syntax: uwsgi_cache_max_range_offset number; Default: — Context: http, server, location This directive appeared in version 1.11.6. Sets an offset in bytes for byte-range requests. If the range is beyond the offset, the range request will be passed to the uwsgi server and the response will not be cached.

uwsgi_cache_lock_timeout

Syntax: uwsgi_cache_lock_timeout time; Default: uwsgi_cache_lock_timeout 5s; Context: http, server, location This directive appeared in version 1.1.12. Sets a timeout for uwsgi_cache_lock. When the time expires, the request will be passed to the uwsgi server, however, the response will not be cached. Before 1.7.8, the response could be cached.