Performance

How to avoid conflicts between cache plugins and CDNs: a practical guide

When you use a cache plugin together with a CDN such as Cloudflare, BunnyCDN or the one built into your hosting, you risk creating two caches that are not in sync. The result: users see old versions of the site or incorrect content.

Why it happens

The cache plugin stores static versions of your pages on the server. The CDN, in turn, stores copies on servers distributed around the world. If the two are not aligned, changes are not propagated straight away.

How to configure the plugin and the CDN

  • Use coordinated purge rules. When you clear the plugin cache, make sure the CDN cache is cleared too.
  • Avoid overly aggressive cache rules. Some plugins set headers that can interfere with the CDN rules.
  • Check the CDN settings. Set up Page Rules or dedicated rules to exclude dynamic pages such as the cart or checkout.
  • Always check what is being served after every update. Test the cache on different devices to make sure everything works.

Conclusion

Caching and CDNs are powerful tools, but they have to be configured properly to work together. If you are not sure how to do it, ask for technical support: preventing problems is better than fixing them afterwards.

Do you have a project to build or to put back in order?

Let's talk