Next.js Discord

Discord Forum

Img counts as bandwidth in Vercel

Answered
Atlantic mackerel posted this in #help-forum
Open in Discord
Original message was deleted.
Answered by riský
if you check the network tab in devtools, you will see every request sent as well as the size... this can also confirm your thoughts
View full answer

14 Replies

if you use next/image, then yes, otherwise, only the code that is sent is used...
also where is the 10mb bandwidth?
that should only use the cdn... vercel shouldn't charge you for it
if you check the network tab in devtools, you will see every request sent as well as the size... this can also confirm your thoughts
Answer
ahh you have alot of middleware
yeah the response and request payloads are counted here
and when using image optimisation, that is also counted (every request, even if cached)
tbh i just do that...
but it can be benifitial to use optimised for lots
Original message was deleted
you can also use next/image and disable optimised images in next config
@riský you can also use next/image and disable optimised images in next config
but i usually just ignore rule for them...
Original message was deleted
for this case, you should put your website behind cloudflare as they cache those js files on their cdn for free + free ddos protection - but you can loose things like knowing the request ip via normal means... (and idk how edge works with it)
you get a header from cloudflare, but you also need to verify that it came from cloudflare because otherwise with deployment url, it is easy to spam...
Original message was deleted
yeah... you may need to enable it (i didn't think so), but it is free and should reduce your costs