• Resolved javelindesign

    (@javelindesign)


    Hi All.. Please help! I have a client who is hosted behind CloudFlare DNS servers for their main/live/production site. They also have a staging server that is an exact clone of the site, NOT hosted with CloudFlare. When I use the Enable Media Replace plugin on the staging server, all works well and as intended. BUT, when I use it on the live/cloudflare DNS version, the plugin doesn’t seem to work. It looks like it replaces the image/file in the media library, but the plugin doesn’t change the actual link on the page from the old filename to the new.

    I figure since the environments are the same except for Cloudflare, that must be the culprit, but I really don’t understand all the rules, CDN, cache, etc. I spoke with the server techs – really nice guys who want to help, but since it’s not their plugin they are limited.. Anyway, their support says:

    “Yes, that makes sense. That plugin must have some IPs, which you can whitelist at Cloudflare end and then its should work after that. As it does changes in database and site end so it must have some bot name or IP that needs to whitelist first on main site where Cloudflare enabled.”

    Does that make sense to anyone? Can someone give me lay person input as to what (and how) to adjust in CloudFlare?

    THANK YOU!

    Jay

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Gerard Blanco

    (@sixaxis)

    Hey Jay,

    This issue is likely caused by Cloudflare caching rather than an IP restriction. Enable Media Replace doesn’t rely on specific IPs, whitelisting, or blacklisting. The plugin simply replaces the physical image file and updates the database, so IPs are not a factor here.

    Since your staging site works fine and only the live site (behind Cloudflare) has the issue, Cloudflare is probably still serving the cached version of the old image. To fix this, you’ll want to clear the cache for that specific file or adjust Cloudflare’s caching settings to prevent it from aggressively storing media files.

    If the image appears updated in the Media Library but not on the front end, your site might also have additional caching layers, such as a page caching plugin or object caching (like Redis or Memcached), that need to be cleared.

    You can also try temporarily disabling Cloudflare’s caching features to confirm whether that’s the root cause. If the issue resolves after that, you’ll know caching is the problem, and you can adjust settings accordingly.

    Hope this helps! Let me know how it goes.

    Cheers,

    Thread Starter javelindesign

    (@javelindesign)

    Hi Gerard, just wanted to circle back on this support topic as it took a bit of troubleshooting. I was wrong about CloudFlare.. it’s not them. The site in question is hosted at WPMUDEV and as part of their optimization services they use a service called “Memecached”? forgive me (I don’t know much about this terminology). Anyway is seems that the plugin isn’t playing well with that and they are not alone in using it, so thought I’d bring it to your attention..

    I asked them what I could tell the developer and this is what they responded with: FYI – thought maybe you could roll something into a future release. THANKS!

    2) I’m happy to try to contact the plugin creator to see if they will change anything, I know you mentioned something about how the plugin is handling the object cache? Can you please tell me in detail what I should suggest they look at and why?

    Let me try to explain, the Object Caching is a cache layer for the database it does store queries so the next time it is required, it is already cached and served from there.

    Certain plugins do direct DB changes (like this one), anyway, that could cause conflicts, if possible, you could try to run the plugin and then clear the Object Caching or check with the plugin support so they can try to make the plugin compatible with our Object Caching which is Memcached, keep in mind that many sites on other hosting services use this (and it’s actually recommended) so the issue could appear on any of these too.

    Plugin Support Gerard Blanco

    (@sixaxis)

    Hi javelindesign!

    Yes, we’re very familiar with Memcached and how it works. However, the purpose of this plugin is to physically replace the files. What happens elsewhere on the website—such as caching mechanisms affecting your site or files—is beyond our control. That’s why we always recommend clearing all caches, including persistent object caching, after a replacement.

    That said, I’ll discuss this with our team to see if there’s anything we can do. Since this is a free and open-source plugin, we’d also be happy to review a Pull Request with a proposed solution on our public GitHub repository:?https://github.com/short-pixel-optimizer/enable-media-replace/

    Thank you for your feedback!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.