不让浏览器缓存index.html

参考文档:https://www.2cto.com/ask/question/4598

 

location = /index.html { add_header Cache-Control "no-cache, no-store"; } no-cache, no-store可以只设置一个no-cache浏览器会缓存,但刷新页面或者重新打开时 会请求服务器,服务器可以响应304,如果文件有改动就会响应200no-store浏览器不缓存,刷新页面需要重新下载页面

 

posted @ 2018-08-31 16:29  水中的火柴盒  阅读(2739)  评论(0编辑  收藏  举报