nginx proxy_cache_revalidate
Syntax: proxy_cache_revalidate on | off; Default: proxy_cache_revalidate off; Context: http, server, location This directive appeared in version 1.5.7.
Enables revalidation of expired cache items using conditional requests with the “If-Modified-Since” and “If-None-Match” header fields.
意思是说,在使用nginx做反向代理的时候,如果缓存文件过期了,需要向源服务器请求资源,“If-Modified-Since” and “If-None-Match” header fields来做验证文件是否需要更新
#这段是互联网上搜索的解释,和我的理解不太一样,我需要做一些测试在知道到底哪种理解是正确的
proxy_cache_revalidate指示NGINX在刷新来自服务器的内容时使用GET请求。如果客户端的请求项已经被缓存过了,但是在缓存控制头部中定义为过期,那么NGINX就会在GET请求中包含If-Modified-Since字段,发送至服务器端。这项配置可以节约带宽,因为对于NGINX已经缓存过的文件,服务器只会在该文件请求头中Last-Modified记录的时间内被修改时才将全部文件一起发送
具体“If-Modified-Since” and “If-None-Match” header fields.是做什么用的,