An open_file_cache for a site with many small assets

Serving a static file involves a stat and an open on every request, which is invisible until the file count is large and the disk is network-backed.

open_file_cache          max=10000 inactive=60s;
open_file_cache_valid    120s;
open_file_cache_min_uses 2;
open_file_cache_errors   on;

# and the consequence: a file replaced on disk is served
# from the cached descriptor for up to open_file_cache_valid.
# fine for hashed asset filenames, wrong for anything
# overwritten in place.

Caching errors as well as successes is the setting people leave off, and it is where most of the benefit is on a site with many 404s — an unmatched URL otherwise costs a filesystem lookup every time. The staleness window is the reason this pairs badly with a deploy that overwrites files in place and pairs well with content-hashed filenames.