Nginx 緩存針對打開的文件句柄與原文件信息

L:108 html

open_file_cachenginx

syntax: open_file_cache off; 緩存

     open_file_cache max=N[inactive=time](inactive表示若是在指定時間內沒有訪問則移除緩存); spa

default: off;3d

context:http,server,locationcode

  

 

open_file_cache_errors 針對緩存信息錯誤的是否緩存server

open_file_cache_min_uses  是指至少使用指定的次數纔會保留在緩存中htm

open_file_cache_valid 根據指定時間肯定緩存是否有效,不然就更新緩存blog

server { listen 80; server_name shop**.com.cn; root /tmp_html; location /{ open_file_cache max=10 inactive=60s; open_file_cache_min_uses 1; open_file_cache_valid 60; open_file_cache_errors on; } } 

 

當咱們用命令 strace -p nginx子進程號去看進程

會發現第一次會有Open打開文件句柄

第二次就沒有open和close操做了 

 

相關文章
相關標籤/搜索