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

prehistoric-beard-84272

10/23/2023, 2:25 PM
Hi team! What does it mean when https://cdn.growthbook.io/sub/sdk-XXXXXXXXX returns
retry: 10000
and empy data objects?
👀 1
b

billions-xylophone-11752

10/23/2023, 2:51 PM
Hey, Sascha - I've pinged someone on the team more familiar with our CDN setup. In the mean time, did this just start happening or are you working on getting set up for the first time?
f

future-teacher-7046

10/23/2023, 3:02 PM
We use Server-Sent Events to stream feature flag and experiment updates down to clients. That way, if you toggle a feature, it can get rolled out to users instantly. What you're seeing is just the event stream - in order to stop the browser from closing the connection, we need to periodically send down messages - hence all the empty "data" lines there. If you were to make a change in GrowthBook and publish it, instead of an empty message, you would see the changes being pushed down to the browser
p

prehistoric-beard-84272

10/23/2023, 3:47 PM
OK thank you! So it is intended for the connection to never close?
f

future-teacher-7046

10/23/2023, 3:49 PM
Yes, although we're working on ways to automatically disable the stream when the page is put into the background to conserve network and battery life. If realtime updates are not important to you, you can disable them by setting
enableStreaming: false
in the SDK (in the latest version)
p

prehistoric-beard-84272

10/23/2023, 4:01 PM
I assume this his primarily for SPAs as the data is being re-fetched on every pageload, even when streaming is disabled, right?
f

future-teacher-7046

10/23/2023, 4:06 PM
Yes, it re-fetches on every page load in general (although we have a local cache layer, so 2 page views close together might not trigger a 2nd network request)
Basically, if you're ok with clients being eventually consistent (usually within a couple minutes), then it's fine to disable streaming. If you want everyone to have the latest version within a second or two, streaming is important
p

prehistoric-beard-84272

10/23/2023, 4:08 PM
OK, got it. Thanks for taking the time and explaining it. I really appreciate it!
3 Views