clean-answer-93696
08/30/2023, 6:33 AMgb = 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?happy-autumn-40938
08/30/2023, 7:32 AMlimited-ram-77544
08/30/2023, 2:41 PMautoRefresh
is set to true
or not?happy-autumn-40938
08/30/2023, 5:05 PMloadFeatures
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.