搜索
您的当前位置:首页正文

静态html页面 缓存

来源:知库网

在index.html里面配置不缓存代码

<pre>

<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<meta HTTP-EQUIV="Expires" CONTENT="0">
</pre>

确保起见 nginx 配置不缓存(单页应用)

<pre>

location = /MicroNew/start.html {
etag off;
add_header Cache-Control "no-cache, no-store";
root /home/new_zhiliao/upload/zhiliao/;
}

</pre>

对资源文件缓存控制 :

  1. 通过版本号来进行 ?v=20150987

  2. 路由通过后面携带version

Top