Cloudinary delivers images and transformed images through a fast content delivery network which caches images for increased performance. This means that accessing a new image at the same exact URL of the image it replaced, might return the previous version of the image.
When you upload an image to Cloudinary without specifying a public ID, a new random ID is automatically generated for that image. It's URL will be unique and you will always get the latest version.
If you do specify a public ID, you will need to add the 'version' parameter to the image's URL to force the new image to show. When you use our upload API, the upload result will contain the 'version' value and a URL with the version part already included.
Alternatively, you can ask to invalidate the caching of the older version of the image.
If I upload an image providing the public_id and therefore overwriting it, will I be able to retrieve the older version? Is there an endpoint for retrieve the file version history and get the file versions timestamps?
I apologize for the delay in response.
Upon overwriting an image you will be able to retrieve an older version if you have automatic backup enabled and want to revert to a specific version.
You can read more on how to do that in this article:
If you want to simply access/view a versioned image you can also click on the version number which will bring up the corresponding image and you can download the image from there.
You can read more on this here:
However, if you would like to have multiple versions of an image you can always place them into a folder so that you can consolidate the different image versions all into one place without having to switch back and forth. Then you can have a setup similar to something like test_folder/img1, test_folder/img2, etc.
I'd like clarity on the management console's invalidate option. Does disabling it mean that whenever I update an image it will immediately invalidate the cached version(s)? If not, how can I achieve that effect? My application lets users update their profile pictures, for example, and they expect to see their latest one as soon as they update it.
The best way to make sure you’re providing an up to date image is by including the version number in the URL. This allows bypassing a previously cached version of the image. If you’d like to read more about image versions feel free to take a look at this article:
Or you can also read our documentation here:
Regarding the console's invalidate option, please keep in mind that this option enables invalidating versioned images only. So you must always be sure to include the version number in your URL. If you don't include the version number in your URL then it will not be invalidated. You can read more about invalidating cached resources and the difference between versioned and unversioned resources in our documentation here:
Is there any option to pass version in cl-image in angular 4
Please sign in to leave a comment.