esl / elixirconf-eu-jekyll

2 stars 6 forks source link

Optimize, minimize, and clean up images #94

Closed sorentwo closed 6 months ago

sorentwo commented 6 months ago

Earlier today, after sharing a link to elixirconf.eu, I noticed that the images were loading very slowly. Inspector shows some multi-megabyte profile images, and the page came in at 23.85MB:

Screenshot 2024-02-29 at 21 40 38

That started me on a campaign to reduce the page size by:

That roughly outlines the commits in this PR, which turned out a bit larger than expected.

Results

The size on initial page load dropped to 1.18MB, about 5% the original size. The assets/images directory also went from 113MB to 7MB.

Screenshot 2024-02-29 at 21 49 38

Changes

Quoting a80145d77:

Speaker pictures use an <img> tag with lazy loading enabled to minimize data fetching on page load. As the image was no longer part of the background, the styling needed updates. As a bonus flourish we now apply filters to the image rather than swapping it out for a solid color.

The result is that images are grayscaled, lightly tinted, and sepia toned rather than swapping to a cyan background:

Screenshot 2024-02-29 at 22 02 54