diff --git a/handler/handler.go b/handler/handler.go index 3afa5af..1dc8d22 100644 --- a/handler/handler.go +++ b/handler/handler.go @@ -1,6 +1,7 @@ package handler import ( + "fmt" "github.com/bluesky-social/indigo/atproto/auth/oauth" "github.com/bluesky-social/indigo/atproto/identity" "github.com/bluesky-social/indigo/atproto/syntax" @@ -351,6 +352,11 @@ func (h *Handler) getuserlikes(w http.ResponseWriter, r *http.Request) { ed.HoverCSS = throt != nil || thsize != nil ed.MarginRight = marginright ed.MarginBottom = marginbottom + cache := q.Get("cache") + cacheage, err := strconv.Atoi(cache) + if err == nil { + w.Header().Add("Cache-Control", fmt.Sprintf("public, max-age=%d, immutable", cacheage)) + } err = embedT.ExecuteTemplate(w, "embedbase.html", ed) if err != nil { log.Println(err)