Updating an image that was previously fetched and then updated via the original remote URL, can be done by either of the following:
- Via the UI, by deleting the resource from the Media Library. It will be automatically invalidated on the CDN and the re-fetched when accessed once again.
-
Via the API, by calling the explicit method with the public ID (i.e., the remote image URL) and setting the
invalidate
flag to true, e.g. (Node.js):cloudinary.uploader.explicit(URL, { type: "fetch", invalidate: true }, function(result) { console.log(result) });
- Via the API, by calling the destroy method with the public ID and setting invalidate: true.
cloudinary.v2.uploader.destroy(URL, { type: "fetch", invalidate: true }).then(callback);
Note that in both flows, the CDN may take few minutes to propagate the purge and bring up the new image.
Comments
0 comments
Please sign in to leave a comment.