react 单页应用,请求的 js 文件response header里有 ETag 和 Last-Modified,在没有重新部署更新的情况下,关闭页面重新打开后并没有使用缓存,没有看到304。
发现js文件的请求 header 中有 Cache-Control: no-cache,代码里只有index.html里有
<meta http-equiv="cache-control" content="no-cache" />
代码里 js 没有设置这种 header。
所以想请问<meta http-equiv="cache-control" content="no-cache" />是只使 index.html 不缓存还是打包后index.html 中的js、css文件也不缓存?
不会。meta http-equiv标签本质是模拟当前页面的 http response header,对其他由本页面发起的请求没有影响。