
Test New Features and Iterate Quickly with Cloudflare Workers - codetrotter
https://blog.cloudflare.com/iterate-quickly-with-cloudflare-workers/
======
codetrotter
Searched for _A /B testing with Cloudflare_ on Google and found this blog post
that was posted by Cloudflare just yesterday.

They have another piece of code example about A/B testing with Cloudflare
Workers that I also found right next to this blog post in the search results.
Said code example is located at
[https://developers.cloudflare.com/workers/recipes/a-b-
testin...](https://developers.cloudflare.com/workers/recipes/a-b-testing/) and
is more concretely like what I was looking for, but the blog post gives
information that lets us do A/B testing per actual user instead of per device.

The code example mentioned in the paragraph above ties user grouping to a
cookie and makes A/B testing quite simple. However, at the same time it also
means that one user with multiple devices could land in different groups on
different devices, so they will see a different version of your site on one
device than they do on another. Which may or may not matter depending on what
you are testing and what they are doing. For example you might be A/B-testing
changes to your landing page, where you are targeting people that have not yet
signed up and so have no account, and then you would still use cookies of
course.

In the article they show how to cache user permissions at Cloudflare edge
servers and they subsequently show how they limit access to features meant for
one group when people from the other group try to access them. Likewise we can
use the cached user permissions instead of cookies when we decide to show one
version of the site or the other.

