Upload and destroy images dynamically doesn't work properly

Comments

5 comments

  • Avatar
    Daniel Mendoza

    Hi @Zankro,

    Thank you, we are glad you enjoy using our product :)

    I believe I know what may be happening. When the images are being overwritten with the same `public_id`, the original images are not invalidated on the CDN. To invalidate the images on the CDN, please include the `invalidate` parameter set to `true`, however, I would advise using the destroy API call instead of `delete_resources_by_prefix`. The destroy API call is not rate limited, and can include the `invalidate` parameter set to `true`. More info can be found here: https://cloudinary.com/documentation/image_upload_api_reference#destroy

    But before you do that, we need to make sure that the correct URLs are invalidated. From the following options outlined here, https://support.cloudinary.com/hc/en-us/articles/360001208732-What-URL-conventions-are-invalidated, which one is used throughout your site? Currently, your account is set to invalidate option 1, but we can change it if needed.

    If you wish to discuss this in private, please feel free to open a support ticket and refer to me. https://support.cloudinary.com/hc/en-us/requests/new

    I am looking forward to your update.

    0
    Comment actions Permalink
  • Avatar
    Zankro

    Hi @Daniel

    I am very grateful that you answered, otherwise I wouldn't figure it out by myself ! It worked perfectly by using invalidate and by set it to `true`. Thank you so much !

    Btw, is there anything I can do to manipulate images faster on-the-fly with node and cloudinary obviously cause my bot need to be very fast but at the same time I don't want to reduce the image quality :3

    Thanks again ;) 

    0
    Comment actions Permalink
  • Avatar
    Daniel Mendoza

    Hi @Zankro

    I'm glad it worked out :)

    There are two options here:

    1. Add `quality` parameter set to `auto` (`q_auto` in URLs) in the welcomeMessageURL, this will reduce the size of the image, but it may not change the amount of time to process. The reason is that there is quite a complex transformation with several overlays going on there.

    2. The second approach would be to reduce the size of the image before upload. The size can be reduced by changing the width and height and you can try to add the parameter `quality` set to `auto` (`q_auto` in URLs) during the upload. This should reduce the size of the file down with minimal effects to the quality. I would give that a go on some sample images and see how it works out.

    Hope this helps!

    0
    Comment actions Permalink
  • Avatar
    Zankro

    Hello again @Daniel Mendoza,

    I thought my code was working but I was wrong... I got a very VERY weird problem that I can't explain by text, i need to talk to you or one person from the cloudinary staff.. Seriously this is getting me mad aha.

    Here is a picture so you can have a preview of my problem : https://imgur.com/a/EX5KjVw

     

    Thank you very much again :)

    0
    Comment actions Permalink
  • Avatar
    Daniel Mendoza

    Hi @Zankro

    It looks like a caching issue, but we will need to do a deeper investigation. Please also share the Cloudinary image URLs of pp1 and pp2 and the Cloudinary URL that has both overlays included?

    Please open a support ticket at https://support.cloudinary.com/hc/en-us/requests/new.

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.