Hi team! What does it mean when <https://cdn.growt...
# ask-questions
p
Hi team! What does it mean when https://cdn.growthbook.io/sub/sdk-XXXXXXXXX returns
retry: 10000
and empy data objects?
👀 1
b
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
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
OK thank you! So it is intended for the connection to never close?
f
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
I assume this his primarily for SPAs as the data is being re-fetched on every pageload, even when streaming is disabled, right?
f
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
OK, got it. Thanks for taking the time and explaining it. I really appreciate it!