Nginx取消html等文件打开的缓存

Nginx Liemer_Lius 462℃

参考: https://nginx.org/en/docs/http/ngx_http_core_module.html#location

配置:

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

Chapter “nginx” in “The Architecture of Open Source Applications”

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;

 

转载请注明:liutianfeng.com » Nginx取消html等文件打开的缓存

喜欢 (2)

评论已关闭。