Some time loading images are very slow


On my product page, some time my images are very slow to show... Here is some example of long waiting time.

Capture d’écran 2021-07-29 à 15.36.37
Capture d’écran 2021-07-29 à 15.41.03

What can I do to avoid this issue ?

You can see it live here :

Hello @maxime.hersand!

Everything looks alright in your screenshots. Experiencing a delay can happen from time to time due to different factors:

  • If it's a raster image (png, jpg) it's served through our image CDN. When first requesting an image with a given transformation (width, height, format, etc.), our server must transform that image to the desired format before sending it back. This can introduce a slight delay. For subsequent calls, the transformed image would have been already cached, so it should be received much quicker;
  • For any asset, the cache on our CDN might be dumped; this can cause an asset to be slightly delayed.

If you notice you experience slow downloads consistently on production, this can hint an issue so let us know! If it's only anecdotic, then it should be alright. In the meantime, an optimization you could do is using DNS-prefetch tags in the head or your website to preconnect to Prismic images and assets CDN:

<!-- Preconnect to Prismic raster image CDN (png, jpg, etc.) -->
<link rel="preconnect" href="" crossorigin />
<link rel="dns-prefetch" href="" />

<!-- Preconnect to Prismic other assets CDN (svg, pdf, mp3, etc.) -->
<link rel="preconnect" href="" crossorigin />
<link rel="dns-prefetch" href="" />

Let us know if anything else comes up!

This thread has been closed due to inactivity. Flag to reopen.