BioDrop icon indicating copy to clipboard operation
BioDrop copied to clipboard

perf: compress site

Open gptkrsh opened this issue 3 years ago • 2 comments

I think it will be a good idea to compress the site and also serve images in webp format, as per my understanding if nextjs converts them to webp, we won't face the api errors

gptkrsh avatar Oct 01 '22 08:10 gptkrsh

Also unsure why tests ran before build...

gptkrsh avatar Oct 01 '22 08:10 gptkrsh

Thanks Krish! But not sure if webp is supported on Mac yet though

eddiejaoude avatar Oct 19 '22 08:10 eddiejaoude

You would be surprised to know, yes, they decided to support webp but not svg: https://caniuse.com/webp

gptkrsh avatar Oct 23 '22 11:10 gptkrsh

Thanks Krish 👍 It would be great to know the size comparison before and after?

Btw I am curious why these are not on by default? There must be a reason?

eddiejaoude avatar Oct 23 '22 16:10 eddiejaoude

NextJS wouldn't fiddle with the quality of the images - but because the avatars/images we don't use aren't so detailed already - we don't need that...

Plus, most websites use it including Discord as well :D

I am not sure about comparison - I'll have to install a bunch more code so that it checks the bundle size each time - but that sounds like not having a place in this PR,

but:

WebP lossless images are 26% smaller in size compared to PNGs. -- developers.google.com

gptkrsh avatar Oct 24 '22 04:10 gptkrsh