0

I'm using Magento v2.3.4 and Cloudflare to cache CSS, js, and images. The problem is when i tried to upload the product image from the backend using the same filename and extension, the image uploader still showing the old image, if i turn off the Cloudflare caching, this issue doesn't exist because the file is not being cached. Is there a way to rename the image where the image is being uploaded using the same filename or extension using the product image uploader ?

enter image description here

1
  • You have to change the image name because clean Cloudflare cache after editing the product image isn't recommended. – MagEx Digital. Sep 24 '20 at 7:02
1

No, you can't because when you are uploading a new image ( not replacing it) then magento do that for you ( rename the file name ).

I will recommend you rename image file name if you want it to reflect on browser. But if you dont change file name than it will reflect when CDN cache expire.

0

I would suggest, disable Cloudflare till you are done with upload images from the backend. Then after you can flush/purge CDN from the cloudflare and enable it in the magento.

If this will not work then follow the below steps:

  1. Disable cloudflare
  2. upload your images
  3. Clear catalog image cache (you can do it from the backend as well as manually remove from the media folder)
  4. Flush/Purch cloudflare CDN
  5. Enable cloudflare, you will see correct images.

I hope this will work for you.

0

My solution would be use Cloud flare apis to purge cache after you have a change in Magento like products, cms etc.

You may use an observer or plugin to achieve the save after actions.

Read this documentation here https://support.cloudflare.com/hc/en-us/articles/200169246-Purging-cached-resources-from-Cloudflare

0

I think the problem is only on your browser, tray on an incognito window or make a hard refresh for the page.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.