Can webp images be used in <head>?
Unanswered
Chinese softshell turtle posted this in #help-forum
Chinese softshell turtleOP
Around a year ago i read somewhere that using webp in meta tags wont work so what i did is when someone uploads an image i was creting jpg and webp versions of that image so i can use the jpg in the meta tags.
Question is can i fully go webp?
Question is can i fully go webp?
19 Replies
@Chinese softshell turtle Around a year ago i read somewhere that using webp in meta tags wont work so what i did is when someone uploads an image i was creting jpg and webp versions of that image so i can use the jpg in the meta tags.
Question is can i fully go webp?
check if this helps: https://stackoverflow.com/questions/57955612/can-we-use-webp-extension-image-in-ogimage-meta-tag
so I don't think you can go fully webp at all, as not all platforms support it, but maybe you can use some workaround for platforms that do support webp
so I don't think you can go fully webp at all, as not all platforms support it, but maybe you can use some workaround for platforms that do support webp
I guess all major platforms support it, but that doesn't mean that all platforms support it
@Anay-208 check if this helps: https://stackoverflow.com/questions/57955612/can-we-use-webp-extension-image-in-ogimage-meta-tag
so I don't think you can go fully webp at all, as not all platforms support it, but maybe you can use some workaround for platforms that do support webp
Chinese softshell turtleOP
seems like it does work for facebook and google
what is your opinion on going full jpg instead? biggest images would be 200-250kb
what is your opinion on going full jpg instead? biggest images would be 200-250kb
ya, go full jpg, 250 kb is basically really less
@Anay-208 ya, go full jpg, 250 kb is basically really less
Chinese softshell turtleOP
i was observing if i should go full webp just because its better but the downside is that it might not work everywhere.
for extra context i have my images stored in cloudflare r2 and i have them cached. And literally the worst case will be 250kb in my head. Also i tested a huge image (6mb png) it was served in 80ms
for extra context i have my images stored in cloudflare r2 and i have them cached. And literally the worst case will be 250kb in my head. Also i tested a huge image (6mb png) it was served in 80ms
so with that being said webp or jpeg with size of 200ish kb would make no difference
@Chinese softshell turtle i was observing if i should go full webp just because its better but the downside is that it might not work everywhere.
for extra context i have my images stored in cloudflare r2 and i have them cached. And literally the worst case will be 250kb in my head. Also i tested a huge image (6mb png) it was served in 80ms
the latency is completely subjective to user's network speed. But yes, I'd say to use jpg only
I personally prefer to use jpg, and webp for images which maybe require a transparent background(when I make apps using expressjs, nextjs handles image optimization on its own)
@Anay-208 I personally prefer to use jpg, and webp for images which maybe require a transparent background(when I make apps using expressjs, nextjs handles image optimization on its own)
Chinese softshell turtleOP
<Image /> component stores cache locally and its like
client -> next.js cache -> cloudflare cache if not next cache -> r2 storage if no cache
while if i dont use <Image /> or if i use unoptimized=true, then its like
client -> cloudflare cache -> r2 storage if no cache
client -> next.js cache -> cloudflare cache if not next cache -> r2 storage if no cache
while if i dont use <Image /> or if i use unoptimized=true, then its like
client -> cloudflare cache -> r2 storage if no cache
Chinese softshell turtleOP
i really dont know if i should use Image component, the host is not that strong and i dont know how its going to handle hundreds of people
the pages will be with ISR
the pages will be with ISR
@Chinese softshell turtle <Image /> component stores cache locally and its like
client -> next.js cache -> cloudflare cache if not next cache -> r2 storage if no cache
while if i dont use <Image /> or if i use unoptimized=true, then its like
client -> cloudflare cache -> r2 storage if no cache
if you use unoptimized, it'll be much slower since image is not optimized
if you still want to your cloudflare, use its image transformation to optimize
research about it
you just have to create a custom loader
to support the cf one
(For any more qs, I'll respond to you tmr)
Chinese softshell turtleOP
i will be uploading optimized images. The images wont be big in dimensions and their quality will be lowered to 80% before uploading to the storage.
i will be having main image, medium and small for the same image
i will be having main image, medium and small for the same image
i cant afford to pay to cloudflare for transformations
alr it should work just fine then