Skip to content

Conversation

@ssddanbrown
Copy link
Contributor

Hello,
Thanks for the great site, I often find it very helpful!

One thing I noticed, was that the site seemed very heavy and slow to load.
Looking at the network info via devtools, I saw that it was loading in 103MB for the main page showing all spools, which was mainly due to there being a lot of relatively large images. That's pretty massive for a web page.

This PR converts image files to AVIF at a 1100x1100 max size via imagemagik using:

mogrify -resize '1100x1100>' -format avif -quality 60 *

For single images, this can also be done via something like squoosh without needing to use the CLI.

I retained the originals, moving them to an originals folder.
I updated references to these optimized images from the portfolio entries.
I chose AVIF due to its wide browser support, with very good quality to file size ratio.

From my testing, this PR reduces the main page load from 103MB to 6.4MB with little impact to perceived quality.

Even 6.4MB is quite a lot. I did attempt to add browser-native lazy image loading to improve this further, but it doesn't work too well with the masonry layout. Could be done though, just with more work by pre-computing image aspect ratios or by using a fixed aspect ratio for all images. Though, I didn't go down these roads to avoid increasing the scope of this PR.

I appreciate you didn't ask for this optimisation/change, so feel free to reject this if you don't want to include these changes for any reason, I'd respect that.

Converted image files to avif, at a 1100x1100 max size via imagemagik
using:
mogrify -resize '1100x1100>' -format avif -quality 60 *

Retained the originals, moving them to a different folder.
Updated references to these images from the portfolio entries.

Reduces main page load from 103MB to 6.4MB.
AVIF chose due to its wide browser support, with very good quality at
smaller screen sizes.
@ssddanbrown
Copy link
Contributor Author

Closing as #38 is a way better version of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant