preview: enable client-side caching for up to 1 year

This commit is contained in:
mappu 2023-05-19 19:12:26 +12:00
parent 3e5fb091c9
commit 01ff8f69aa

View File

@ -104,6 +104,7 @@ func (this *Server) handleThumbInternal(ctx context.Context, w http.ResponseWrit
return err return err
} }
w.Header().Set(`Cache-Control`, `max-age=31536000, immutable`)
w.Header().Set(`Content-Length`, fmt.Sprintf("%d", len(thumb))) w.Header().Set(`Content-Length`, fmt.Sprintf("%d", len(thumb)))
w.Header().Set(`Content-Type`, `image/jpeg`) w.Header().Set(`Content-Type`, `image/jpeg`)
w.WriteHeader(200) w.WriteHeader(200)