From 38191d55be24627afbe9ae9c564dc0e96d8b8f25 Mon Sep 17 00:00:00 2001 From: JustSong Date: Mon, 22 May 2023 00:39:24 +0800 Subject: [PATCH] fix: do not cache index.html --- router/web-router.go | 1 + 1 file changed, 1 insertion(+) diff --git a/router/web-router.go b/router/web-router.go index 71e98c27..60e1d127 100644 --- a/router/web-router.go +++ b/router/web-router.go @@ -16,6 +16,7 @@ func SetWebRouter(router *gin.Engine, buildFS embed.FS, indexPage []byte) { router.Use(middleware.Cache()) router.Use(static.Serve("/", common.EmbedFolder(buildFS, "web/build"))) 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) }) }