Nginx缓存命中分析

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/longgeqiaojie304/article/details/85337219

Nginx缓存命中分析

1、缓存命中分析方式

(1)方式一

        通过设置Response头信息Nginx-Cache

        add_header Nginx-Cache “$upstream_cache_status”

 

(2)方式二

       通过设置log_format打印日志分析

 

2、$upstream_cache_status详解

3、缓存命中配置

4、验证缓存命中配置是否生效

(1)第一次请求访问,Nginx-Cache:MISS

(2)第二次请求访问,Nginx-Cache:HIT

(3)第三次请求访问(删除Cache文件),Nginx-Cache:MISS

猜你喜欢

转载自blog.csdn.net/longgeqiaojie304/article/details/85337219