Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
add cache control to static files
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Sep 23, 2021
1 parent 94fd91f commit 0db0ddd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/server_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ func (s *Server) webHandle(w http.ResponseWriter, r *http.Request) {
case "download":
s.dlfilesh.ServeHTTP(w, r)
case s.baseInfo.Version:
w.Header().Set("Cache-Control", "max-age:290304000, public")
s.verStatich.ServeHTTP(w, r)
default:
//no match, assume static file
w.Header().Set("Cache-Control", "max-age:290304000, public")
s.statich.ServeHTTP(w, r)
}

Expand Down

0 comments on commit 0db0ddd

Please sign in to comment.