Image caching question

Hi there,

I’m struggling to create a page that loads a single, random image + caption from a collection each time a page loads. Our developers used a VeloCode solution that didn’t fully work: there was always a 1+ second flash of an initial image + caption on the screen, followed by the final pair loading. The flashing is disconcerting mainly because you can clearly see pair A, then it switches to pair B.
I’ve tried many different code iterations, and even consulted a second developer who says, “appears is a standard behavior of dynamic web pages (Client-Side Rendering)”

I tried one more solution that appears to work, but that I have questions about: I removed all Velocode from the page and only had it linking to the dataset directly, with the dataset set to Random Order. Then I disabled caching for the page. In terms of the image loading, it works just as required now. But here’s my question: For a page that only contains a single image plus a small logo graphic, how problematic is it to disable caching for the pages?
We are not showing the photos on mobile.

I appreciate any insight from the community!

Don

Not problematic at all, would only ever save milliseconds at best, unless the image is super heavy.

But a different solution can be to have the image collapsed/hidden by default, and only show once the dataset is loaded

$w(‘#dataset’).onReady(() => $w(‘#img’).show()) // or expand()
1 Like

Hi Dean,

Thanks for the reply! You would not believe the number of different coding solutions we tried between 2 sets of devs and 2 different AI’s. First, to make the images and captions match and second, this image flashing issue. So far, disabling caching is the only thing that has worked, so I really appreciate your confirmation that this is a reasonable solution.

Cheers,

Don

1 Like