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?
This instructs our plugin which variant (the original if
nab=0 or an alternative version if
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).
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.