https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
e

enough-camera-24490

12/07/2023, 5:44 PM
We are hoping to use growthbook for feature flagging for both a PHP application and a React application. If we wanted to directly connect to a Redis cache with the PHP application, what is the preferred way to update that with changes to the feature definition. It sounds like the Proxy is the best option, but the docs are not super clear how we would talk with the Redis instance directly. i.e what i the cache key? With the webhooks deprecated, what is the best solution for this?
r

rhythmic-agent-34208

12/07/2023, 5:44 PM
Our official support hours are 6:30am - 5pm Pacific Time, Monday through Friday. You may occasionally hear from us outside of these hours. Your support request has been logged in our system. Our support team will get back to you very soon!
f

future-teacher-7046

12/07/2023, 8:08 PM
The legacy SDK webhooks are still the best solution for this right now. We are actively working on a replacement within the newer SDK Connections that should be available within the new few weeks.
h

happy-autumn-40938

12/07/2023, 8:47 PM
I think the proxy is your best option. In this scenario, it serves as a smart wrapper around your Redis cache store and handles all the updating logic for you. It also unlocks some cool things like streaming changes to connected clients (React SDKs in your case)
e

enough-camera-24490

12/07/2023, 8:50 PM
@happy-autumn-40938 Using the cloud service and the proxy is what I was hoping to do. Having issues with the redis store not updating when a change is made. I am reaching straight into the redis store from our php application to reduce latency.
h

happy-autumn-40938

12/07/2023, 8:55 PM
That's a less common use case (hitting Redis directly instead of the proxy). I wouldn't recommend it unless you're running into latency obstacles. The proxy already keeps a short-TTL in-mem cache in addition to using Redis on the backend, so it should be pretty fast in most scenarios. You could also consider a low-TTL memcached wrapper in PHP to reduce the hops.
also if you hit the proxy directly, the built in SWR logic will trigger a Redis cache reseed whenever something is missing in Redis
e

enough-camera-24490

12/07/2023, 9:04 PM
We were trying to avoid maintaining a low TTL wrapper so we could get faster updates when we change a feature defintion. Especially with streaming changes to the React app, we want there to be minimal mismatch of evaluations if we are need to toggle something in React and PHP.
h

happy-autumn-40938

12/07/2023, 9:08 PM
by avoid a low TTL wrapper, I assume you are talking about a custom memcached solution and not the proxy itself? The proxy should update just as fast (if not faster) than the streaming updates over CDN. Are you not seeing that?
if you are seeing a race condition where our CDN beats your own proxy (which I don't think should be happening 🤷 ), then you could switch the front-end SDKs to use the proxy endpoints as well
e

enough-camera-24490

12/07/2023, 9:13 PM
Working on getting the proxy setup. I had been testing it locally, but never updated the proxy url on the sdk connection, which explains why I was not seeing any updates
👍 1
3 Views