image version control
Hi Support, we updated one of our images yesterday and noticed that if we use the version number in the URL we see the updated image but without the version number we still get the previous image?
link with version number: http://res.cloudinary.com/tg4/image/upload/v1507558593/047922.jpg (works ok)
link without version number: http://res.cloudinary.com/tg4/image/upload/047922.jpg (does not work)
We recall all our images use the Cloudinary base URL + our product code, so we don't know what the version number is. We have not noticed a problem with this in the past. We have tried clearing browser cache etc but still the same issue.
Any help with be very much appreciated.
Thanks
John
-
Hi John,
Thank you for your question!
When you upload a new image while specifying its
public_id
to be the same as an existing image, your Cloudinary account will be updated with the new image overwriting the old one. However, if the original (older) image has already been accessed, it might already be cached in the CDN: if you access the exact same URL you will still be accessing a CDN cached version rather than the new updated one.You can read more about it here:
https://support.cloudinary.com/hc/en-us/articles/202520912-What-are-image-versions-
Thanks,
-
Hi Shirly, thanks for your feedback. We still have the same issue as described above with version control. I can understand that there may be a delay before the latest image update overwrites the old image but we have the same issue one week on? If the version number is not included in the URL then the wrong image is being returned.
I have not seen this issue with other images we have updated (we have about 30K images on Cloudinary) and we update them regularly. Would you mind having a look at the links above and let me know what you think?
Thanks
John
-
Hi Shirly, I have tested another image update and I am seeing the same issue again. if you compare these two links: http://res.cloudinary.com/tg4/image/upload/047934.jpg
this link is the most recent update: http://res.cloudinary.com/tg4/image/upload/v1508239649/047934.jpg
I have cleared the browser cache and used different browsers but still getting the same issue. How long will the image remain in the Cloudinary Cache?
Thanks
John
-
Hi John,
Thank you for reaching out.
When uploading an already uploaded image you can use the versioned url from the upload callback and use it instead of the previous (original) one.
The image can be cached in the CDN for up to 30 days.
You can read more about it here:
Please let me know if that answers your questions,
Thanks,
-
Hi Shirly, thanks for your feedback. We are unable to use the versioned url as we don't know what the version number is prior to recalling the image from the server. We therefore need to recall the image using the public_id which in this case is our product code. Any device requesting images from our server forms the URL by using the Cloudinary base URL plus our in-house product code. Like this: http://res.cloudinary.com/tg4/image/upload/047934.jpg
Is there a way that we can request the CDN Cache to be cleared when updating an image or can you do it automatically when an image has been updated?
Thanks
John
-
Hi John,
Alternatively, if you are using our API, you can set the `
invalidate`
parameter to `true`
while uploading in order to invalidate the image through the CDN. Note that it might take up to an hour for the invalidation to fully propagate through the CDN, while theversion
component affects immediately. When uploading via the Media-Library the invalidation comes built-in in the request.You can read more about it here:
https://cloudinary.com/documentation/upload_images#invalidating_cached_images_on_the_cdn
Thanks,
Shirly
Post is closed for comments.
Comments
6 comments