Add cache headers to static files and etags to performer images (#337)

This commit is contained in:
InfiniteTF
2020-01-31 23:20:14 +01:00
committed by GitHub
parent 6a6e8d8875
commit cd9c6e998e
2 changed files with 17 additions and 0 deletions

View File

@@ -196,6 +196,10 @@ func Start() {
data, _ := uiBox.Find("index.html")
_, _ = w.Write(data)
} else {
isStatic, _ := path.Match("/static/*/*", r.URL.Path)
if isStatic {
w.Header().Add("Cache-Control", "max-age=604800000")
}
http.FileServer(uiBox).ServeHTTP(w, r)
}
})