resizing images to reduce bandwidth usage

This commit is contained in:
rramiachraf 2022-10-24 21:32:38 +01:00
parent 409f49a4c5
commit 2230a5ffd8

View File

@ -30,7 +30,8 @@ func proxyHandler(w http.ResponseWriter, r *http.Request) {
return
}
url := fmt.Sprintf("https://images.genius.com/%s.%s", f, ext)
// first segment of URL resize the image to reduce bandwith usage.
url := fmt.Sprintf("https://t2.genius.com/unsafe/300x300/https://images.genius.com/%s.%s", f, ext)
res, err := http.Get(url)
if err != nil {