vue nginx项目配置 处理缓存
# 增加不缓存index.htmllocation = /index.html {root/usr/local/test-frontend/clientPlatform/dist;add_header Cache-Control "no-cache, no-store";}```root/usr/local/test-frontend/clientPlatform/dist;这个设置 ..
·
# 增加不缓存index.html
location = /index.html {
root /usr/local/test-frontend/clientPlatform/dist;
add_header Cache-Control "no-cache, no-store";
}
```
root /usr/local/test-frontend/clientPlatform/dist;
这个设置 第一次忘记设置这个一直报错
html页面设置
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate">
nginx 批量设置
location / {
root /usr/local/test-frontend/ez-platform;
try_files $uri $uri/ /index_prod.html;
index index_prod.html index.html;
# 增加不缓存index.html
if ($request_filename ~* .*\.(?:htm|html)$)
{
add_header Cache-Control "no-cache, no-store"; #对html文件设置永远不缓存
}
}
更多推荐
已为社区贡献3条内容
所有评论(0)