Caching of images and versioned file paths
I have a program that runs which captures an image and stores it on my cloudinary instance, this image must retain the same path and filename as it's hard coded into an app. In the example below i'm passing ovewrite: true and overwriting the version file path that get's added, but I'm not able to overwrite the image, it's stuck in cache and I can't get it to update without generating a new versioned file path (which I don't want to do).
sample code of my call
cloudinary.config({
cloudName: 'name',
apiKey: '12345566',
apiSecret: 12345678',
});
cloudinary.v2.uploader.upload(fullPath, {
resource_type: 'image',
public_id: 'project',
overwrite: true
}, function (error, result) {});
Is there a max age setting that can be passed? Also, in the upload setting's in my account I disabled invalidate versioned url's
Ex URL:
https://res.cloudinary.com/project/image/upload/v1519439673/sample.png
Thanks
Jonah
-
Hi Jonah,
To bypass the CDN completely we recommend using version numbers when serving your URLs.
Alternatively, when using the API, you can set the
invalidateparameter totruewhile 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 theversioncomponent affects immediately. When uploading via the Media-Library the invalidation comes built-in in the request.Please take a look at the following for more information- https://support.cloudinary.com/hc/en-us/articles/202520852-Handling-the-CDN-s-cache-when-updating-a-resource
0
Post is closed for comments.
Comments
1 comment