"Replace asset" still showing the old picture

I’ve seen several topics about it but none exactly like this so it might be “new”?

When I use the “replace assets” feature (see screenshot), the front-end keeps on showing the old picture instead.

The blurry dataset (using imgix) actually shows the new colors (greenish) but the resulting source, after replacement within the component, shows the old asset.

Also, when you hover over the asset to choose a new focal point, the appearing modal is showing the old version so the issue is not only limited to our front-end (see 2nd screenshot).

Something with the URL not changing after changing the asset?

Hi @kevin.cocquyt,

Does this happen to you frequently/consistently? If so, can I ask which part of the world you’re in (so we can see if it might be a regional network thing related to our CDN)?

Normally, if you replace an asset and keep the original URL, our CDN needs a bit of time (maybe like 30-60 seconds, typically) to invalidate the cached version and replace it with the new one. We try to accommodate for this already, but maybe there are some conditions (like certain edge nodes in certain parts of the world, or perhaps a certain browser configuration) that may cause the cached version to stick around longer than expected.

If you wait a min or two and then hard refresh the asset page again, does it show the new version then?

Hi.

I’m in Belgium (Europe) and it’s been 1.5 days since the image was change but the result stays the same, even with a hard refresh in the browser.

It’s also kinda strange that “focal point” modal is showing the old version…

@kevin.cocquyt Could you please post or DM me a link to that specific image in your media area so I can take a look?

Does it happen to ALL images you upload, or was it just a fluke with that one?

This is the actual image URL: https://www.datocms-assets.com/185683/1774365612-quick-scan-app-rekken-verpakking.webp

It’s the only 1 I know of that was changed using the “replace” feature as that was done by our customer’s editor.

It’s kinda weird, when you go to the URL that was copied from the asset, you see the green packaging but this URL comes back from the Content API and shows the yellow packaging: https://www.datocms-assets.com/185683/1774365612-quick-scan-app-rekken-verpakking.webp?auto=compress

@kevin.cocquyt,

I manually purged that image’s cache for you, and now it should show correctly everywhere:

Please have your customer’s editor check again, and if it still shows the old yellow version, please ask them to “hard refresh” their browser to clear its local cache.

Meanwhile, I will try to see if I can figure out if a specific bug caused this, or if it was just an random invalidation fluke… (sometimes, very rarely, the CDN fails to properly invalidate an image and keeps serving the stale version). If you notice any other images “stuck” like this, please let us know.

But for now, that one image should be correctly “refreshed” with the latest version. Sorry about that!

Now we see the right image in the front-end.

I’ll the editor know about it and thank you for the swift response.

Sometimes IT happens :slight_smile:

Thanks, Kevin!

I tried to replicate this (hoping it was a webp-specific issue) but could not. If you notice any additional instances of this happening, please do let me know and we’ll keep investigating.

I also asked the devs if we could provide the manual invalidation functionality directly in the media area, in case this happens again to you or anyone else. (Right now, a manual cache clear requires support intervention. Letting customers do it for their own assets would make it easier/quicker to resolve the “stale” images on your own, in the rare cases they happen.) I’ll update this thread if we’re able to add that.