Next/Image Super High Bandwidth Issue when fetching from Sanity
Unanswered
Tomistoma posted this in #help-forum
TomistomaOP
Howdy all!
I am seeing super high bandwidth usage, and I am not sure what is going on or how to reduce the amount of bandwidth. I have two domains which both fetch all the site images from sanity using Sanity CDN. Both domains show the same thing, only difference between them is that one of the domain has much more traffic due to ads. The site is not large only has a landing page and a thank you page (when a form submission occurs). I use Next’s Image component.
Any suggestions on what I can do to lower this bandwidth usage are much appreciated.
Here are screenshots of my usage in Vercel:
I am seeing super high bandwidth usage, and I am not sure what is going on or how to reduce the amount of bandwidth. I have two domains which both fetch all the site images from sanity using Sanity CDN. Both domains show the same thing, only difference between them is that one of the domain has much more traffic due to ads. The site is not large only has a landing page and a thank you page (when a form submission occurs). I use Next’s Image component.
Any suggestions on what I can do to lower this bandwidth usage are much appreciated.
Here are screenshots of my usage in Vercel:
6 Replies
Toyger
what is sanity cdn? because from image looks like you use vercel cdn.
and you need to check are you images optimized on site, also how big is DAU, because maybe this is just real traffic.
and you need to check are you images optimized on site, also how big is DAU, because maybe this is just real traffic.
TomistomaOP
both sites combined are averaging 800 DAU. The images are housed inside sanity cms and the src of the images in my project are coming from urls that are from https://cdn.sanity.io/...
TomistomaOP
I am going to try to not use the Next Image component to see if it lowers the amount of bandwidth thats used. According to DevTools network tab in incognito mode with cache off, the page load is 41.6 MB transferred and 43.2 MB resources
800 dau x 45mb each = 32gb / day, if thats the correct way of calculating it.
800 dau x 45mb each = 32gb / day, if thats the correct way of calculating it.
In vercel its showing 8gb approx daily bandwidth usage, so not sure how correct my formula is.
@Tomistoma I am going to try to not use the Next Image component to see if it lowers the amount of bandwidth thats used. According to DevTools network tab in incognito mode with cache off, the page load is 41.6 MB transferred and 43.2 MB resources
800 dau x 45mb each = 32gb / day, if thats the correct way of calculating it.
Toyger
as you say 43.2 it's in incognito mode, so some users already have some data cached that's why it's 8gb average.
and actually 43.2 mb per page is bad, probably you better reduce some of content and maybe optimize it manually.
about sanity.io not sure what your src, but if you have 300gb on vercel, then vercel more likely serves all of your content, or you have some other big size content that served through vercel.
and actually 43.2 mb per page is bad, probably you better reduce some of content and maybe optimize it manually.
about sanity.io not sure what your src, but if you have 300gb on vercel, then vercel more likely serves all of your content, or you have some other big size content that served through vercel.
TomistomaOP
I've added the unoptimized flag to all the next image components as a tmp test, and will keep an eye on it. I plan on compressing the images even further but I agree 40+mb is not good. All my media is webp already and i have compressed 40mb+ jpgs (original) to less than 1mb webp each (optimized) but there are tons (over 80) full-width images in various carousel components.