nyancodeid/quotes

Optimize: reduce github avatar size

Closed this issue · 1 comments

For now we are consuming the github avatar provided by github directly. The truth is that github provides an avatar image of about 420x420 in size with the byte size being around 29Kb-30Kb. This makes our website load heavily by thinking about the number of github avatars that are loaded, even though we have implemented lazy loading on images but if there is still a way to optimize it, why not?

So github has an additional parameter in its avatar url, namely s= which has a positive integer value that represents the width of the image. We can use this method to reduce the image size, because we only need 24x24 size so we can add s=24 behind our github avatar url in <QuoteCard /> component. We can reduce byte size of image up to ~94%. Such drastically different right?.

I working on it, so i'm ganno ship this update soon.

Done!