All the information you need in one place

Is Nelio A/B Testing compatible with cache plugins?

Absolutely! Nelio A/B Testing will work properly even if your WordPress site is behind a cache system or a CDN. If you want to know how, keep reading.

How do caches and CDN networks work?

The idea of caching is actually pretty simple. WordPress is a content management system and, as such, it runs every time it receives a request and generates the requested page “on the fly,” which will always take some time and server resources. A cache is a system aimed at solving this particular issue: the first time the server receives a request, WordPress runs and it generates the response page, but from that moment on, the cache keeps a copy of this response page and returns it directly, thus preventing WordPress from ever running again.

A CDN is just an extra layer of complexity that follows the same idea: it keeps a cached copy of the response page. The only difference is that this time cached copies are stored in multiple servers across the globe. This way, when a user requests a page, the CDN will serve the page using the closest server available, thus speeding up transfer times.​

This solution, however, comes with its own problems. Essentially, if you change anything in your website and there’s a cached copy in your cache/CDN, the latter will be out of synced and, if the user is served the cached copy, they’ll see “old content.” Cache and CDN systems implement several mechanisms to cope with this: they might keep a cached copy for a limited amount of time only, they might request an updated version on their own and keep it cached, or they might update their cached copies upon request of the WordPress server itself.

But what about split testing in particular?

The challenge of caches

Cache mechanisms are a real challenge for A/B testing. When your website is behind a cache, it’s possible that all your visitors end up seeing the same (original) variant, thus making A/B testing impossible.

Some A/B Testing plugins for WordPress are simply not compatible with caches and make you choose between performance and conversion optimization. Nelio A/B Testing, on the other hand, is not only compatible with caches, but it even makes use of them!

How does Nelio A/B Testing use caches?

When you run a test on a page, our plugin adds a tiny inline script in it. This inline script is basically telling our plugin “hey, this page is under test, these are the variants the visitors might be assigned, and these are the goals and actions that should trigger a conversion.” When a user lands on a tested page, our plugin’s JavaScript files look for this inline script and determines if the current page is under test. If it is, it performs a redirection to a different URL that includes a special query arg:


This instructs our plugin which variant (the original if nab=0 or an alternative version if nab=1 or nab=2) has to be loaded. Thanks to this parameter, your cache system will see different URLs depending on which alternative is being loaded and, therefore, it will cache each alternative as if they were different pages (even though some are just a variant of the former).

This “testing” parameters are added by our tracking JavaScript on the client side. You can read more about how Nelio decides when alternative content has to be loaded and how it’s requested.

Keeping everything in sync

After starting or stopping a test, the cache and CDN networks should be flushed, just to make sure that there aren’t any cached versions of your site in which the tested page is out of sync. Our plugin comes with several hooks to automatically flush the cache of some common cache-plugins for WordPress, but you may need to do this manually.

Person writing a new WordPress post on a MacBook

Looking for popups?

We have the best plugin to create popups for WordPress in minutes.

Request Customized Enterprise Pricing


With your express consent, we handle the information provided for the purpose of contacting you and until you ask us to delete it.



Claim Your Discount Now

Image with a 10%-off coupon


Get this awesome discount now!

No, I don't want to save money

Image with a 10%-off coupon


Get this awesome discount now!

No, I don't want to save money


This site uses proprietary operational cookies that have a purely functional purpose and third-party cookies that help us understand how visitors interact with the site by collecting and presenting information anonymously. To get more information about these cookies and the processing of your personal data, check our Privacy & Cookie Policy. Do you accept these cookies and the processing of personal data involved?

If you don’t, you can reject non-operational cookies and continue browsing this site by clicking here.