Mastering Nginx

(Ron) #1

The NGINX HTTP Server


[ 142 ]

Directive Explanation
fastcgi_cache_bypass One or more string variables, which when
non-empty or non-zero, will cause the
response to be taken from the FastCGI
server instead of the cache.
fastcgi_cache_key A string used as the key for storing and
retrieving cache values.
fastcgi_cache_lock Enabling this directive will prevent multiple
requests from making an entry into the
same cache key.
fastcgi_cache_lock_timeout The length of time a request will wait for
an entry to appear in the cache or for the
fastcgi_cache_lock to be released.
fastcgi_cache_min_uses The number of requests for a certain key
needed before a response is cached.
fastcgi_cache_path A directory in which to place the cached
responses and a shared memory zone
(keys_zone = name:size) to store active
keys and response metadata. Optional
parameters are:


  • levels: Colon-separated length of
    subdirectory name at each level (one
    or two), maximum of three levels
    deep

  • inactive: The maximum length of
    time an inactive response stays in the
    cache before being ejected

  • max_size: The maximum size of
    the cache; when the size exceeds
    this value, a cache manager process
    removes the least recently used items

  • loader_files: The maximum
    number of cached files whose
    metadata are
    loaded per iteration of the
    cache loader process

  • loader_sleep: The number of
    milliseconds paused between each
    iteration of the cache loader process

  • loader_threshold: The maximum
    length of time a cache loader iteration
    may take

Free download pdf