1. 配置nginx缓存html

1.1 修改配置文件

location / {
 expires 1h;
 root /home/html;
 index index.html index.htm;
 ## html缓存 
 if ($request_filename ~* .*.(htm|html)$){
     add_header Cache-Control "no-store";
 }
}

1.2 验证

在这里插入图片描述

2. Vue项目修改根目录index.html

//head添加以下代码,会使所有打css/js资源重新加载
<meta http-equiv="pragram" content="no-cache">
<meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate"&gt;

原文地址:https://blog.csdn.net/weixin_42202992/article/details/132799478

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_39174.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注