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 ?
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:
- Disable cloudflare
- upload your images
- Clear catalog image cache (you can do it from the backend as well as manually remove from the media folder)
- Flush/Purch cloudflare CDN
- Enable cloudflare, you will see correct images.
I hope this will work for you.
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