thousands-holiday-24345
09/03/2025, 7:27 PMthousands-holiday-24345
09/03/2025, 7:30 PMconst growthbook = new GrowthBook({
apiHost: "<https://cdn.growthbook.io>",
clientKey,
});
we are just using the default settings
is adding the following enough, or should we also disable backgroundSync entirely?
configureCache({
staleTTL: 1000 * 60 * 60, // expire after 1 hour
});thousands-holiday-24345
09/03/2025, 7:30 PMthousands-holiday-24345
09/03/2025, 8:07 PMthousands-holiday-24345
09/03/2025, 8:21 PMstrong-mouse-55694
09/03/2025, 9:05 PMloadFeatures is deprecated. You should use init instead.
• With init, you can then set streaming: false. Those SSEs are because of streaming, which is for realtime feature updates. Setting this to false will greatly reduce your CDN calls. Additionally, you can then also implement more aggressive caching with this: https://docs.growthbook.io/lib/js#cachingthousands-holiday-24345
09/04/2025, 3:00 AMconst growthbook = new GrowthBook({
apiHost: "<https://cdn.growthbook.io>",
clientKey,
backgroundSync: false,
});
and
growthbook.init({streaming:false})
?
Also do we need to keep
setInterval(
() => {
growthbook.refreshFeatures();
},
1000 * 60 * 15
);
if we want to make sure the feature flag are not too stale right? Or can we remove this and rely on cache being stale?strong-mouse-55694
09/04/2025, 4:56 PMthousands-holiday-24345
09/04/2025, 7:19 PMthousands-holiday-24345
09/04/2025, 7:21 PMThe first code instantiated the GrowthBook class and the second runs the init method,I meant there's
backgroundSync: false, option in the first code. what's the diff between that option and streaming:false ?strong-mouse-55694
09/08/2025, 9:03 PMbackgroundsync is deprecated.