index.html 缓存问题
index.html 不应该被缓存,每次前端资源打包后相关资源是`/static/js/6.c78c6791.chunk.js` 存在哈希值的,index.html 被缓存后,由于index.html 中的引用路径没有发生变化,导致缓存无法及时更新。理想状态下,当前端资源发生变化的时候,在下一次页面刷新应当可以加载最新的资源。
This commit is contained in:
parent
243c312066
commit
a0507a55d0
1 changed files with 1 additions and 1 deletions
|
@ -66,7 +66,7 @@ func FrontendFileHandler() gin.HandlerFunc {
|
|||
return
|
||||
}
|
||||
|
||||
if path == "/service-worker.js" {
|
||||
if path == "/service-worker.js" || path == "/index.html" {
|
||||
c.Header("Cache-Control", "public, no-cache")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue