feat: add caching into image proxy

This commit is contained in:
rramiachraf 2024-03-06 12:08:01 +01:00
parent 6d6ffa16ff
commit edc2b04198

View File

@ -53,6 +53,7 @@ func ImageProxy(l *logrus.Logger) http.HandlerFunc {
} }
w.Header().Add("Content-type", fmt.Sprintf("image/%s", ext)) w.Header().Add("Content-type", fmt.Sprintf("image/%s", ext))
w.Header().Add("Cache-Control", "max-age=1296000")
if _, err = io.Copy(w, res.Body); err != nil { if _, err = io.Copy(w, res.Body); err != nil {
l.Errorln("unable to write image", err) l.Errorln("unable to write image", err)
} }