teacherfund / TeacherFund_next

A website to fund teachers discretionary spending because the government sucks at it
https://theteacherfund.com
MIT License
90 stars 87 forks source link

Optimize images for faster loading time #122

Closed meowwwls closed 5 years ago

meowwwls commented 5 years ago

I used TinyPNG to optimize the images currently in use, shaving as much as 79% off of the file sizes. Only only will this help with load time, but will help save mobile users quite a bit of data.

Ideally I think there should be a setup to automatically optimize images, but I'm not sure of the best way to set that up, so I did it manually for now.

Note: the largest pencils photo was too big to run through TinyPNG so that was not optimized.

With the optimizations, the loading time of the home page was cut from more than 5 seconds (on non-throttled internet) to just a bit over 2s. Page size went from around 6mb to a bit under 3mb.

Original time and page size

Loading time and page size after changes

When throttled to fast 3G, the loading time went from to around 35 seconds to around 14 seconds.

Original time when throttled to fast 3g

Loading time when throttled to fast 3gafter changes

vercel[bot] commented 5 years ago

This pull request is automatically deployed with Now. To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://teacherfund-git-fork-meowwwls-fix-optimize-images.teacherfund1.now.sh

stripedpajamas commented 5 years ago

👏👏👏