server-configs-nginx/h5bp/web_performance/cache-file-descriptors.conf

27 lines
1.3 KiB
Nginx Configuration File
Raw Normal View History

2018-11-25 22:07:01 +01:00
# ----------------------------------------------------------------------
# | Cache file-descriptors |
# ----------------------------------------------------------------------
# This tells Nginx to cache open file handles, "not found" errors, metadata about files and their permissions, etc.
#
# The upside of this is that Nginx can immediately begin sending data when a popular file is requested,
# and will also know to immediately send a 404 if a file is missing on disk, and so on.
#
# However, it also means that the server won't react immediately to changes on disk, which may be undesirable.
#
# In the below configuration, inactive files are released from the cache after 20 seconds, whereas
# active (recently requested) files are re-validated every 30 seconds.
#
# Descriptors will not be cached unless they are used at least 2 times within 20 seconds (the inactive time).
#
# A maximum of the 1000 most recently used file descriptors can be cached at any time.
#
# Production servers with stable file collections will definitely want to enable the cache.
2018-11-25 22:07:01 +01:00
#
# https://nginx.org/en/docs/http/ngx_http_core_module.html#open_file_cache
2018-11-25 22:07:01 +01:00
open_file_cache max=1000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
2018-11-25 22:07:01 +01:00
open_file_cache_errors on;