https://www.growthbook.io/ logo
#announcements
Title
# announcements
s

stocky-nest-15851

07/18/2023, 3:22 PM
Hello there 🙂 I have some problems related to caching / stale / something else using the CDN version of the free plan of GB. It seems that the online version caches the feature values for a very long time (minutes) but I'm not able to find a way to refresh these values in "real time". Am i missing something?
Copy code
useEffect(() => {
  growthbook.loadFeatures({autoRefresh: true});
}, []);
do it, doesn't it?
s

swift-helmet-3648

07/18/2023, 6:13 PM
Hi, I spoke with our devs about this. Here's what they said
We still haven't rolled out realtime streaming support to all of our GrowthBook Cloud users yet. That's coming within the next couple weeks. Self-hosted users can enable it today by using the GrowthBook Proxy.
For Cloud users, the
autoRefresh
setting will not do anything today. We tell people to add it now so that they are ready to take advantage of realtime streaming when it's released soon.
If the person wants to force a refresh (e.g. on navigation in a SPA), there's a
refreshFeatures
method they can call on the SDK. It has some debounce logic to avoid a bunch of rapid fire API calls (only hits the CDN if it's been at least 60 seconds since we last fetched). That can be disabled if needed by doing
gb.refreshFeatures({skipCache: true}}
, but we don't recommend it unless the person really knows that they are doing.
🙌 1
15 Views