Bri*_*den 5 javascript google-chrome angular
在Windows版Chrome上不会发生这种情况,在Mac OS版Chrome上不会发生这种情况。Chrome并没有从服务器请求新资产,而是尝试从以前的npm构建中检索旧的应用程序捆绑包哈希,并且该应用程序无法加载!
这对我来说没有意义,app- [hash] -bundle.js已更改,hash已更改,应该破坏Chrome缓存。
我不确定该怎么做,我不必做类似app- [hash] -bundle.js?refresh = [ticks]之类的散列操作,其目的相同。
我也经历过这种情况,当浏览器拒绝从缓存中删除文件时,这真是令人沮丧。发生这种情况是因为您的浏览器已缓存该index.html文件。您可以尝试以下几种方法来解决这个问题:
1.添加meta标签index.html
尝试将这些添加到<head>index.html 中,然后清除缓存。这并不总是有效/不是推荐的方法。
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
Run Code Online (Sandbox Code Playgroud)
2.禁用Chrome缓存
使用此设置禁用 Chrome 缓存以防止index.html被缓存。
| 归档时间: |
|
| 查看次数: |
99 次 |
| 最近记录: |