打包项目更新到服务器时可能会存在缓存问题,需要在服务器中进行配置。
location = /index.html {
add_header Cache-Control "no-cache, no-store";
}
no-cache, no-store可以只设置一个
no-cache浏览器会缓存,但刷新页面或者重新打开时 会请求服务器,服务器可以响应304,如果文件有改动就会响应200
no-store浏览器不缓存,刷新页面需要重新下载页面。
完美解决
打包项目更新到服务器时可能会存在缓存问题,需要在服务器中进行配置。
location = /index.html {
add_header Cache-Control "no-cache, no-store";
}
no-cache, no-store可以只设置一个
no-cache浏览器会缓存,但刷新页面或者重新打开时 会请求服务器,服务器可以响应304,如果文件有改动就会响应200
no-store浏览器不缓存,刷新页面需要重新下载页面。
完美解决