https://www.growthbook.io/ logo
b

brave-manchester-11480

05/20/2022, 4:34 PM
Does growthbook a/b testing work with React server side rendering? I found client side rendering example using CSR but couldn't find anything about SSR. https://dev.to/jdorn/ab-testing-with-create-react-app-53fg Also docs don't mention anything about it. https://docs.growthbook.io/lib/react
f

future-teacher-7046

05/20/2022, 5:31 PM
Yes, it should work for SSR. The React SDK does not rely on any browser-specific features
b

brave-manchester-11480

05/20/2022, 5:36 PM
ok great. and It says "Local targeting and evaluation, *no HTTP requests*" what does it mean? Shouldn't it fetch a/b tests data like percentage from growthbook?
f

future-teacher-7046

05/20/2022, 6:22 PM
The SDK itself just takes a JSON object as input with all of the feature and experiment configuration data. Fetching and caching that JSON file is up to you
👍 1
b

brave-manchester-11480

05/20/2022, 6:28 PM
how does it serve variants based on percentage?
logic is based on Math.random or something else?
f

future-teacher-7046

05/20/2022, 6:29 PM
We hash the user id and experiment id to a number between 0 and 1. Each variation is assigned a range and the user is assigned whatever range they fall into
We use the FNV hashing algorithm.
b

brave-manchester-11480

05/20/2022, 6:32 PM
I read that but one thing I don't understand how does it decide which user will fall into which range on their first visit?
f

future-teacher-7046

05/20/2022, 6:35 PM
The other thing you pass into the SDK besides the experiment configuration are user attributes. These include things like logged in userId, anonymous deviceId, etc.. You are responsible for generating and storing these IDs yourself, whether that's in cookies or elsewhere.
As long as you pass the same user id in, they will be assigned the same variation
b

brave-manchester-11480

05/20/2022, 6:38 PM
I get how repeat visits works. but my question was for first visit where library decides to assign x% user to variation a and y% user to variation b. if it is server side i know server can split traffic based on x and y % and serve variants but for client side library how does it can determine this percentage distribution?
f

future-teacher-7046

05/20/2022, 6:40 PM
It works exactly the same way. You pass in a user id and experiment configuration and it does the hashing to assign a variant. Doesn't matter if it's client side or back end.
👍 1
b

brave-manchester-11480

05/20/2022, 6:46 PM
okay and where growthbook server and db is hosted? I am interested in this so I can determine latency when I do client side fetch from various locations to growthbook for experiment data.
f

future-teacher-7046

05/20/2022, 6:49 PM
GrowthBook cloud is hosted in AWS us-east, but we have a global CDN in front of the feature endpoint. We also recommend people use a caching layer within their own infrastructure like Redis.
b

brave-manchester-11480

05/20/2022, 6:53 PM
thanks for prompt response. If I update something in GrowthBook cloud. how long it takes for old data to be purged from the cdn cache?
f

future-teacher-7046

05/20/2022, 6:54 PM
Up to 1 minute
1
4 Views