Why wasn't my URL properly invalidated?

UPDATE: this topic was recently added to our documentation section.

When uploading/deleting via the UI, a CDN invalidation request is being sent along automatically. When using the API, the invalidate flag must be set to true (default is false)

It's important to know that Cloudinary only invalidates certain variants of URLs according to the following policy:

  • A resource located in root (e.g. sample.jpg):
    Only the unversioned URL will be invalidated by default: https://res.cloudinary.com/demo/image/upload/sample.jpg
  • A resource located within a folder hierarchy (e.g. folder/subfolder/sample.jpg)
    Only the "v1/" versioned URL will be invalidated by default: https://res.cloudinary.com/demo/image/upload/v1/folder/subfolder/sample.jpg

This policy derives from the SDK helper methods behavior in regards to constructing the URLs. One can ask to change this behavior globally on his account to invalidate only unversioned URLs for both scenarios (root/folders).

Another thing to take into consideration is that URL paths are case sensitive. Therefore:
https://res.cloudinary.com/demo/image/upload/sample.jpg
is different than (capital S):
https://res.cloudinary.com/demo/image/upload/Sample.jpg
In such case Cloudinary will use the public ID which was originally used to store the resource.

Have more questions? Submit a request

Comments

  • Avatar
    Leo Fouchard

    "One can ask to change this behavior globally on his account to invalidate only unversioned URLs for both scenarios (root/folders)."

    Where can we change that, should I ask the support or can it be done on the settings?
    Thanks!

  • Avatar
    Nadav Ofir

    Hi Leo, please open a support ticket and share some information regarding your use case so we'll be able to fit the right solution for you.

  • Avatar
    Vishal Gupta

    hi, i am having a guest account and I donot want to use version in my image cloudinary url, the value of "Invalidate versioned URLs" in upload settings is set to disabled. However everytime i upload (drag/drop) images to Cloudinary admin console, all the images are versioned with v141231333 or next random number. Also if i upload say 17 images in single drag/drop upload, some of the images are versioned say v14441, v14442 and so on.. Please advise as how to fix this?

  • Avatar
    Nadav Ofir

    Hi Vishal, actually there's nothing to fix here.
    Our media-library always shows versioned URLs, however you can omit it when embedding it to your application. It's on our roadmap to allow hiding the version components in via the account settings.

    Note that this has nothing to do with the "Invalidate versioned URLs" settings which is used to modify the invalidation policy on your account.

  • Avatar
    Vishal Gupta

    Thanks Nadar, I am clear now. While doing more R&D, I did try to hit the URL without version and it worked and thanks for updating the documentation as well. Issue resolved

  • Avatar
    Roman Weinstein

    Hello,
    How can I invalidate not versioned url?

  • Avatar
    Nadav Ofir

    Hi Roman,
    Please open a support ticket and share some details regarding your use-case / workflow and our team will be happy to set it up for you.

  • Avatar
    Stacey Osiecki

    I'm having a similar issue with validity, using the fetch mode? This image was 404 when first attempted to fetch, the source URL is now valid, but I can't get Cloudinary to refetch it?

    https://res.cloudinary.com/resource-decor/image/fetch/w_500,h_400,c_pad,f_jpg/http://www.resourcedecor.com/public/images/1404002_angle-4.jpg

  • Avatar
    Nadav Ofir
  • Avatar
    Stacey Osiecki

    Yes, it does look very much like a cached 404, but what can be done in this situation?

  • Avatar
    Nadav Ofir

    Normally these errors are cleared automatically after a short while (up to 24hrs). If this is a repeating issue then you may want to look at the following recommended practice: https://support.cloudinary.com/hc/en-us/articles/212491405-How-to-avoid-broken-URLs-when-operating-multiple-unsynchronized-platforms-

Powered by Zendesk