Imgix and broken image links

Hi all,

I haven’t used Imgix as a DAM connection (yet), just directly with CloudCannon stored images.

I found an issue when adding images on a page where the CloudCannon Visual Editor was open. If my page template applied Imgix transformation URLs, I often saw broken images. I think it was because the visual editor was rendering the page and calling the Imgix transformation URL before the image was actually available at the CloudCannon end. And Imgix seemed to persist these broken links in its cache.

To get around this, I added a check for the development branch in my template (where I don’t need to optimise). If true, I use the original images and apply ‘aspect-ratio’ and ‘object-fit’ CSS rather than Imgix. That keeps my layout the same as the production site but without the broken images in the editor and on the development URL.

There might be better ways to sort this and it may not even be an issue anymore. I thought I’d share in case it helps anyone.

2 Likes