Hi everyone, my name is Antoni and I'm a developer...
# ask-questions
d
Hi everyone, my name is Antoni and I'm a developer at omnicalculator.com. We used to do A/B tests with Google Optimize, but after a while of inactivity in this area (and the sunset of their platform), we chose Growthbook as the best looking alternative for us. Our site's infrastructure consists of an AWS-hosted server which is covered by KeyCDN for cost and performance reasons. After a fantastic demo with Matthew, in order to preserve those CDN-related benefits, we decided to try and integrate a Cloudflare Worker before the CDN, so that we could invoke some lightweight logic on the edge — like checking if a Growthbook test is enabled — and then serving the user a different page variant directly from KeyCDN. It proved to be quite troublesome, however, and so I was wondering whether anyone here was dealing with a similar setup, and if so, what worked for you.
f
What problem were you running into?
d
Thanks for a quick reply, we had no issues with Growthbook's SDK, but rather the infra itself. Here is a brief diagram of how our current "flow" looks like: 1. User enters omnicalculator.com/finance 2. The DNS resolves the domain to the AWS server 3. The server redirects them to the
www
subdomain which has a CNAME record pointing it to KeyCDN 4. What the user sees at www.omnicalculator.com/finance is a cached version of the page served by KeyCDN
Here is how it would look like with the Cloudflare Worker:
There is an infinite redirect potential when the KeyCDN pulls content from our server, but we have a logic to prevent that (the CDN is set up to forward the host header for example). With the additional step of a Cloudflare Worker, we would have to rewrite this logic as it was causing many networking problems. While this is obviously doable we decided it would be worth asking if anyone here was dealing with a similar setup before proceeding with further work.
cc @purple-book-37233