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

clean-answer-93696

08/30/2023, 6:33 AM
Hi with regards to python sdk, I see this example:
Copy code
gb = GrowthBook(
  api_host = "<https://cdn.growthbook.io>",
  client_key = "sdk-abc123",
  # How long to cache features in seconds (Optional, default 60s)
  cache_ttl = 60,
)
gb.load_features()
Question: So let's say my app started I called gb.load_features() and after 5 minutes I went and update configuration of a feature, will growthbook sdk know to get an update or is it trusting me to keep call gb.load_features() periodically?
h

happy-autumn-40938

08/30/2023, 7:32 AM
The latter. Only JS/React and I believe Java currently support streaming updates (i.e. feature/experiment updates). Streaming updates for more platforms is coming soon!
👍 1
l

limited-ram-77544

08/30/2023, 2:41 PM
@happy-autumn-40938 To clarify on the same note, for React/JS SDKs, the worst case scenario for an update to be reflected live will be 60 seconds right? Or does this depend if
autoRefresh
is set to
true
or not?
h

happy-autumn-40938

08/30/2023, 5:05 PM
For JS/React, if you have streaming turned off (autoRefresh: false) then the TTL will be the minimum staleness (age) of your cached features. So if you call
loadFeatures
before the TTL expires, the SDK will just used the cached copy instead of fetching new features. You can override the TTL to not be 60 seconds, ex:
configureCache({staleTTL: 5000})
. However, without streaming, the SDK will keep stale results indefinitely until something triggers a refetch (i.e. a user triggering another
loadFeatures
call). With streaming enabled, none of this matters because the SDK will get instant feature updates from the server, which bypasses the cache/TTL logic entirely and re-seeds your SDK cache.
👍 1
7 Views