When you overwrite an existing image with a new file that uses the same
public_id value your Cloudinary account will be updated with the new image and new requests we receive for that resource will be served the new image right away.
If the resource was already in use in your application or website, when accessing existing URLs for that resource you may still see a CDN cached version of the previous image instead of the new updated image.
There are two ways to handle this.
Firstly, you can include the version component as part of the URL. The version number of the asset is included in the
version property that's included in our Upload API and Admin API responses, and it's also included in the path to the image returned in the
secure_url parameters of those APIs, and in the URLs retrieved through our media library
If you keep your database up to date with the version number for each resource and use it in the URLs that your application creates, you'll always get the newest version of the image: https://cloudinary.com/documentation/upload_images#asset_versions
Alternatively, when using the API, you can set the
invalidate parameter to
true in your call to the upload API to request that we invalidate the CDN cache for the image. When using our Media Library UI, invalidation is requested automatically. Note that it typically takes a few seconds to take effect, but invalidation can take up to an hour to fully propagate through our CDNs.
When invalidation is requested Cloudinary sends invalidation requests for the same URL format created by our SDKs by default, which does not include the version component, but includes a 'v1' placeholder instead of the version when the image is in a subfolder of your account.
If you're using a different method to generate your URLs, you may need to account for this in your account settings or ask us to change the invalidation behavior for your account
If you wish to invalidate "versioned" URLs instead of this default, you should enable the 'Invalidate versioned URLs' in your account's Upload settings page.
For more information about CDN invalidations, please see the upload API documentation