From edc2b04198617f1beac3f7527ef968c1d4a4e6ca Mon Sep 17 00:00:00 2001 From: rramiachraf <51409801+rramiachraf@users.noreply.github.com> Date: Wed, 6 Mar 2024 12:08:01 +0100 Subject: [PATCH] feat: add caching into image proxy --- handlers/proxy.go | 1 + 1 file changed, 1 insertion(+) diff --git a/handlers/proxy.go b/handlers/proxy.go index 3f85baa..420b79c 100644 --- a/handlers/proxy.go +++ b/handlers/proxy.go @@ -53,6 +53,7 @@ func ImageProxy(l *logrus.Logger) http.HandlerFunc { } 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 { l.Errorln("unable to write image", err) }