| Syntax: | fastcgi_cache_valid [ code ...] time |
| Default: | |
| Context: | http server location |
| Reference: | fastcgi_cache_valid |
Directive sets caching period for the specified http return codes. For example:
fastcgi_cache_valid 200 302 10m; fastcgi_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:
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":
fastcgi_cache_valid 200 302 10m; fastcgi_cache_valid 301 1h; fastcgi_cache_valid any 1m;