cache media
parent
9bda977a29
commit
03565e4fbc
|
|
@ -50,6 +50,8 @@ func Run(ctx context.Context, args []string) error {
|
|||
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if strings.HasPrefix(r.URL.Path, "/media/") {
|
||||
http.StripPrefix("/media/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Cache-Control", "private, max-age=31536000")
|
||||
w.Header().Add("Cache-Control", "immutable")
|
||||
http.FileServer(http.Dir(*d)).ServeHTTP(w, r)
|
||||
})).ServeHTTP(w, r)
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in New Issue