When you overwrite an existing asset 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 asset was already in use in your application or website, when accessing existing URLs for that asset, you may still see a CDN cached version of the previous file instead of the new, updated image. It's also possible that your browser or another third-party cache has stored the old file and is still showing it to you.
Firstly, when overwriting the asset, if you set the
invalidate parameter to
true in your API call, we will send requests to our CDNs to clear any cache for the overwritten asset. This parameter is sent automatically if you replace an asset using our Media Library UI. Note that it typically takes a few seconds for the invalidation to be processed take effect, but invalidation can take up to an hour to fully propagate through our CDNs.
By default, all possible delivery URLs for an asset will be invalidated, but if you have an older account using non-standard options, you may need to ask us to change the invalidation behavior for your account.
For more information about CDN invalidations, please see the upload API documentation
Bypassing browser and other caches
Alternatively, or if you need to bypass users' browser caches as well as our CDN caches, you can include the optional version component as part of your asset delivery URLs.
The version number of an asset is included in the
version property when you receive the asset's details using our Upload API and Admin API responses. The
secure_url parameters of our APIs also include an asset's current version, as do the URLs retrieved through our media library UI.
If you keep your database up to date with the version number for each asset and use it in the URLs that your application creates, you'll always receive the newest version of the asset, even if the user or a third party has cached it: https://cloudinary.com/documentation/upload_images#asset_versions