Browse Source

feat:禁用浏览器缓存

wangshan 2 years ago
parent
commit
84e259f555
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/jfw/modules/app/src/app/front/tags.go

+ 4 - 0
src/jfw/modules/app/src/app/front/tags.go

@@ -67,6 +67,10 @@ func init() {
 
 
 func (tg *Tags) TagsIndex(types, name string) error {
 func (tg *Tags) TagsIndex(types, name string) error {
 	defer qu.Catch()
 	defer qu.Catch()
+	//禁用页面缓存
+	tg.ResponseWriter.Header().Set("Cache-Control", "no-cache,no-store,must-revalidate")
+	tg.ResponseWriter.Header().Set("Prama", "no-cache")
+	tg.ResponseWriter.Header().Set("Expires", "0")
 	if userId, _ := tg.GetSession("userId").(string); userId != "" {
 	if userId, _ := tg.GetSession("userId").(string); userId != "" {
 		return tg.Redirect("/jy_mobile/tabbar/home")
 		return tg.Redirect("/jy_mobile/tabbar/home")
 	}
 	}