Can I update my image link?
I made modifications to an image wich has a version in Cloudinary. I want to upload this modified image but retaining the same link as the one already stored so I don't have to update the link in my web page. Is this possible?
-
Cloudinary delivers all images and raw files through a fast content delivery network which caches files for increased performance. This means that accessing a new file at the same exact URL of the file it replaced (including the same version number), might return the previous version of the image.
When you upload a file to Cloudinary without specifying a public ID, a new random ID is automatically generated for that image. Its 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 new 'version' number to the image's URL to force the new file 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. It is recommended to add the version part to bypass CDN caching.
Another option you can choose is to set the
invalidate
parameter totrue
while uploading to invalidate any cached versions of your image and forcing the delivery of the new image. Here's an example in rails:Cloudinary::Uploader.upload('new-image.jpg', :public_id => 'image', :invalidate => true)
Note that it might take up to 1 hour for the invalidation to fully propagate.
0 -
Thanks! I'll check it :)
0 -
Is there a way to set
invalidate
totrue
when uploading through Cloudinary's Media Library > Upload Images interface?0 -
When uploading / deleting via the Media library, Invalidation is enabled by default.
0 -
hmmm...this doesn't seem to be the case. we have uploaded images using the same name and returns the old version if the version component of the url isn't included.
0 -
Hi Doug,
Can you please share an example of a URL which wasn't invalidated for you? If privacy is an issue, you're always welcomed to open a support ticket.
0 -
i'm confused - uploading an image with an existing filename (basically, updating an image) - without using the version as part of the url - would return the 'old' copy that was in the CDN, well over an hour later. ...much like this link: http://support.cloudinary.com/entries/23138893-I-ve-replaced-an-existing-image-with-a-new-one-but-my-website-stills-shows-the-old-one-Why-is-that-
...has the cloudinary's web uploading (media library > upload images) interface changed recently?
we are in the process of writing a little script to use your API (and pass invalidate: true) because uploading via the web (again, using the same filename, and *not* using the version) would not invalidate the CDN by default.
0 -
Hi Doug,
If you encountered any specific issues with images which weren't invalidated successfully, please share some more information with us, including the specific URLs and maybe the time of the image update, so we'll be able to able to further understand the issue.
Thanks
0 -
Go the same issue
-old file
http://res.cloudinary.com/sistv/image/upload/badges/leonesa.pngnew file http://res.cloudinary.com/sistv/image/upload/v1441617255/badges/leonesa.png
Uploaded about an hour ago (2015-09-07 09:14:15)
Any idea what this happened ?
0
Post is closed for comments.
Comments
9 comments