fix: do not cache index.html

This commit is contained in:
JustSong 2023-05-22 00:39:24 +08:00
parent d9e39f5906
commit 38191d55be

View File

@ -16,6 +16,7 @@ func SetWebRouter(router *gin.Engine, buildFS embed.FS, indexPage []byte) {
router.Use(middleware.Cache()) router.Use(middleware.Cache())
router.Use(static.Serve("/", common.EmbedFolder(buildFS, "web/build"))) router.Use(static.Serve("/", common.EmbedFolder(buildFS, "web/build")))
router.NoRoute(func(c *gin.Context) { router.NoRoute(func(c *gin.Context) {
c.Header("Cache-Control", "no-cache, no-store, must-revalidate")
c.Data(http.StatusOK, "text/html; charset=utf-8", indexPage) c.Data(http.StatusOK, "text/html; charset=utf-8", indexPage)
}) })
} }