加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

缓存 – 在NGINX`position`指令中`expires -1’是什么意思?

发布时间:2020-12-13 21:30:48 所属栏目:Nginx 来源:网络整理
导读:鉴于下面的示例位置示例,-1表示过期是什么意思?这是否意味着“永不过期”或“永不缓存”? # cache.appcache,your document html and datalocation ~* .(?:manifest|appcache|html?|xml|json)${ expires -1; access_log logs/static.log;} https://github.

鉴于下面的示例位置示例,-1表示过期是什么意思?这是否意味着“永不过期”或“永不缓存”?

# cache.appcache,your document html and data
location ~* .(?:manifest|appcache|html?|xml|json)${
  expires -1;
  access_log logs/static.log;
}

https://github.com/h5bp/server-configs-nginx/blob/master/h5bp/location/expires.conf

最佳答案
根据nginx manual,该指令将Expires和Cache-Control HTTP标头添加到响应中.

值-1表示这些标头设置为:

Expires: current time minus 1 second

Cache-Control: no-cache

总而言之,它指示浏览器不要缓存文档.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读