Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance by resizing/converting images #99

Open
captainbrosset opened this issue Nov 17, 2023 · 1 comment
Open

Improve performance by resizing/converting images #99

captainbrosset opened this issue Nov 17, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@captainbrosset
Copy link
Owner

Images tend to be quite big, but they're mostly shown at small sizes on the site.

They appear at max ~450 pixels in the various lists of tips.
And at max ~800 pixels in a tip page.
Only when you click on the image do you see it full size.

We should therefore generate thumbnail versions of all images (at 450px and 800px) at build time, preferably as WebP format, and then use these instead of the original images.

The Image plugin should be able to do this: https://www.11ty.dev/docs/plugins/image/

Doing this would have the biggest impact on the load performance of the website.

@captainbrosset captainbrosset added the enhancement New feature or request label Nov 17, 2023
@pankajparashar
Copy link
Contributor

An alternative could be to host the images on Image CDNs like Cloudinary (which offers a generous free tier), and then dynamically fetch images of different sizes, shapes and formats by just altering the URL.

Example,

# original image
https://res.cloudinary.com/<project>/image/upload/example1.png

# image with width 450px
https://res.cloudinary.com/<project>/image/upload/w_450/example1.png

# image in webp format
https://res.cloudinary.com/<project>/image/upload/w_450/example1.webp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants