open_file_cache

Syntax: open_file_cache off;
open_file_cache max=N [inactive=time];
Default: open_file_cache off;
Context: http, server, location

Configures a cache that can store:

  • open file descriptors, their sizes and modification times;
  • information on existence of directories;
  • file lookup errors, such as “file not found”, “no read permission”, and so on.
    Caching of errors should be enabled separately by the open_file_cache_errors directive.

The directive has the following parameters:

max
sets the maximum number of elements in the cache; on cache overflow the least recently used (LRU) elements are removed;
inactive
defines a time after which an element is removed from the cache if it has not been accessed during this time; by default, it is 60 seconds;
off
disables the cache.

Example:

open_file_cache          max=1000 inactive=20s;
open_file_cache_valid    30s;
open_file_cache_min_uses 2;
open_file_cache_errors   on;
doc_nginx
2017-02-09 07:07:57
Comments
Leave a Comment

Please login to continue.