Have you guys thought about what it would look lik...
# give-feedback
Have you guys thought about what it would look like to leverage Cloudflare Workers to bucket cached A/B responses so the origin server would not have to render each request?
My origin server is totally stateless, so right now I either have to disable A/B testing on initial page loads, hide my tests behind spinners, or let customers see a flash of one variant before it switches to another
I don't want to send every request to my origin if possible. So I'd like to use a worker to track my Growthbook flags, and which features are present on which of my routes, then use the growthbook library to bucket a request, then modify the request to my origin server based on what features they should be shown That way, my server can remain entirely stateless. And if the combination of features for this request has already been rendered, the worker will return the cached Cloudflare data instead of making the request to the origin
Before starting on this path I was wondering if you had any feedback or experience (or a prebuilt plugin) to assist, that works with Workers + KV to implement something like this
The general concept is outlined here. Getting it to work with Growthbook would be slightly more work but should be doable https://developers.cloudflare.com/workers/examples/ab-testing/
@echoing-memory-34743 Let me sync with the team and see if anyone has a good solution around this.
Looks like it might be tricky to import the Growthbook library into a Cloudflare worker An easier approach would be to let Cloudflare bucket traffic - but it looks like in order for it to be an A/B experiment in Growthbook I have to let Growthbook do the hashing? Could I set up an "identifier" in GB that is just "A" or "B" (picked by Cloudflare) and use that for my experiment configuration? Or would that not be enough to guarantee that Growthbook buckets them the way I want