[edit] uwsgi_cache_valid

syntax: uwsgi_cache_valid [http_return_code [...]] time

default: none

context: http, server, location

Directive sets caching period for the specified http return codes. For example:

uwsgi_cache_valid  200 302  10m;
uwsgi_cache_valid  404      1m;

sets caching period of 10 minutes for return codes 200 and 302 and 1 minute for the 404 code.

In case only caching period is specified:

uwsgi_cache_valid  5m;

the default behavior is to cache only replies with the codes 200, 301 and 302.

It's also possible to cache all the replies by specifying code "any":

 
uwsgi_cache_valid  200 302 10m;
uwsgi_cache_valid  301 1h;
uwsgi_cache_valid  any 1m;

Module: HttpUwsgiModule