by Pikamander2 · 1y ago · 0 comments
1. Convert the images to WEBP or AVIF or at least run them through something like TinyPNG to compress them better.
2. Save two versions of each images; a 75x75 version that gets used for the 75px thumbnails shown on the page, and a 500x500 version that appears in the lightbox after a thumbnail is clicked.
3. Only load a few dozen thumbnails at first and then load more after the user scrolls down or clicks a "show more" type button.
I recommend and use Cloudinary. Cloudinary can take care of all that for you!
For point 3:
You can add laoding="lazy" to the image tag, and get lazy loading for free, supported by the browser:
* https://developer.mozilla.org/en-US/docs/Web/Performance/Laz...