feat: add caching into image proxy
This commit is contained in:
parent
6d6ffa16ff
commit
edc2b04198
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user