目录
1.nginx原生web缓存处理
2.nginx原生web缓存缺陷
3.nginx缓存改造思路
nginx原生web缓存处理
nginx缓存索引及配置信息存在于
struct ngx_http_file_cache_s {
ngx_http_file_cache_sh_t *sh; //共享内存(主要保存缓存索引信息)
ngx_slab_pool_t *shpool; //共享内存的slab内存分配器
ngx_path_t *path; //缓存所配置的路径
ngx_path_t *temp_path; //缓存临时文件路径 可配置
off_t max_size; //配置的最大缓存大小
size_t bsize;//缓存传输块大小
time_t inactive; //conf配置的缓存有效期 缓存超过有效期时间 会被cache manager主动清理
time_t fail_time;//主要在缓存共享内存中申请内存失败 失败的时间
ngx_uint_t files; //缓存加载进程loader 中使用的文件加载数量