Browse Source

feat:缓存

wangshan 2 years ago
parent
commit
09c5b4f59a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/jfw/modules/app/src/app/front/search.go

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

@@ -54,6 +54,10 @@ func (s *Search) Site() error {
 
 func (s *Search) MainSearch() error {
 	if userId, _ := s.GetSession("userId").(string); userId == "" {
+		//禁用页面缓存
+		s.ResponseWriter.Header().Set("Cache-Control", "no-cache,no-store,must-revalidate")
+		s.ResponseWriter.Header().Set("Prama", "no-cache")
+		s.ResponseWriter.Header().Set("Expires", "0")
 		return s.Redirect("/jyapp/tags/home/home.html")
 	}
 	return s.Redirect("/jy_mobile/tabbar/home")