Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
ulfklose
Experienced
Topic Author
Posts: 48
Joined: 10 Dec 2019, 09:10

[Flamepix] Reuploading an image with the same name

29 Dec 2019, 18:31

I just replaced an image in two galleries with another one with the exactly same name but with different content. Although I loaded the gallery in different browsers and using the private mode in them the old image shows up. 

This happens in the backend AND in the frontend. 

It's this image in particular: https://www.ulfklose.wedding/hochzeiten ... kristof-18
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: [Flamepix] Reuploading an image with the same name

29 Dec 2019, 20:35

This is because you have the benefit of the Cloudflare CDN to cache and speed up delivery of static assets (images). The old image gets cached on a CDN close to your geographic location, and that is why you don't see the updated image (until it is purged from CDN by some automated event). This is how all CDN services work, and the best logical way to avoid this issue, is to use name versioning (eg. use a new file name). Optionally, we could disable CDN caching, but that's not generally a productive solution.

You can purge the file from the Cloudflare dashboard also (now managed by me), but that is a tedious process that would have to be done every time you change a file (and keep the same name). If you want to be able to do this, we would need to move your domain back to your own Cloudflare account.

For now, I have flushed the CDN cache for the image:
https://www.ulfklose.wedding/content/ho ... of_18.jpeg

PS! If you want to check if image is being cached on CDN, you can add some random ?param at the end of the image url. For example:
Kristof_18.jpeg
Kristof_18.jpeg?123

The bottom url will force a new request and bypass the CDN. Keep in mind, the request with ?123 will get cached also on the CDN, so if you change the image again, you will need to use a new param ?1234. This itself is not a solution, but just a way for you to detect if CDN is caching a specific image.

I guess we could consider an automated solution for this in the future using the Cloudflare API.
 
User avatar
ulfklose
Experienced
Topic Author
Posts: 48
Joined: 10 Dec 2019, 09:10

Re: [Flamepix] Reuploading an image with the same name

30 Dec 2019, 08:10

mjau-mjau wrote: I guess we could consider an automated solution for this in the future using the Cloudflare API.
That would be awesome. But for now I'll handle this renaming the images.

Thank you.