https://cloudinary.com/ is a 3rd party service which we recommend as a convenient way to transform assets on the fly to change their size or format.
When building sites for fast performance, there is often a compromise with convenience. Tools like Google Page Speed Insights remind you to store multiple sized versions of the same image in order to optimise them to different sized device screens and resolutions. You also want to serve images in next-gen formats like webp
, but your client will usually upload jpg
or png
images.
Cloudinary allows you to get the best of both worlds, by using the Siteglide File Manager's AWS CDN to store single original copies of each image for a clutter-free, easy experience for clients, while in the code you can dynamically transform images to optimise them perfectly to the site vistors. Cloudinary also caches their transformations, so after the first time they are delivered as fast as if you had already uploaded different versions to the CDN.
Go to https://cloudinary.com/ and follow the steps to create an account.
This will be an essential part of the URLs.
https://cloudinary.com/documentation/cloudinary_credentials_tutorial
To build a URL, you will need to start with the beginning of the Cloudinary URL, which will direct the browser to their API endpoint, replacing 'demo' with your cloud name from step 2:
https://res.cloudinary.com/demo/image/fetch/
\
Next add your optional transformations to resize the image by a number of pixels width or height:
https://res.cloudinary.com/demo/image/fetch/h_200,w_200
Next optionally add transformations to automatically transform to next-gen image formats on supported browsers only:
https://res.cloudinary.com/demo/image/fetch/h_200,w_200/f_auto/
then use Liquid to get the path to the original image on Siteglide's CDN. See
For example:
{{'images/example.jpg' | asset_url}}
Putting it all together:
Learn more about the
There are many more options available. Read more here:
https://cloudinary.com/documentation/image_transformations In these examples, you may need to replace 'upload' with 'fetch' in the URL to support remote images from the Siteglide file manager.
Also check out using client hints on some browsers to further fine-tune image requests:
https://cloudinary.com/documentation/responsive_server_side_client_hints