add Cache-Control header for assets

This commit is contained in:
Shawn Smith
2017-10-21 08:08:12 +09:00
parent d474db8e4a
commit 81f83e1c42

View File

@@ -8,6 +8,7 @@ import (
// AssetsHandler handles serving static files
func AssetsHandler(w http.ResponseWriter, r *http.Request) {
log.Println("Serving " + r.URL.Path[1:])
w.Header().Set("Cache-Control", "max-age=86400")
http.ServeFile(w, r, r.URL.Path[1:])
}