square-restaurant-38765
07/19/2023, 4:12 PMfresh-football-47124
square-restaurant-38765
07/19/2023, 4:14 PMfresh-football-47124
square-restaurant-38765
07/19/2023, 4:14 PMfresh-football-47124
square-restaurant-38765
07/19/2023, 4:22 PMbetter-magician-65629
07/19/2023, 5:20 PMinitialize()
method called.
example code:
• java spring: https://github.com/growthbook/examples/tree/main/jvm-spring-web
• kotlin ktor: https://github.com/growthbook/examples/tree/main/jvm-kotlin-ktor-example
you can read about how to use the class here, and how the refreshing and cacheing logic works: https://docs.growthbook.io/lib/java#fetching-cacheing-and-refreshing-features-with-gbfeaturesrepository
you can see the javadoc class docs here: https://growthbook.github.io/growthbook-sdk-java/growthbook/sdk/java/GBFeaturesRepository.html
this should give you what you need to make requests and refresh features.square-restaurant-38765
07/19/2023, 6:58 PMbetter-magician-65629
07/19/2023, 7:16 PMttlSeconds
for the GBFeaturesRepository
? if it's 0 then it'll go out every time, but that is not the default, the default is 60 seconds.square-restaurant-38765
07/19/2023, 7:34 PMGBFeaturesRepository
refreshes stale data every 60 seconds by making call to the Growthbook features endpoint right ?
If yes, I asked if i can get the features value instead of making an API call everytime. Server sent events would be the perfect.
But yes, instead of making feature API call for each users, i can make API call every 60 seconds to refresh data. This would help in someway. Thanksbetter-magician-65629
07/19/2023, 7:36 PMsquare-restaurant-38765
07/19/2023, 7:37 PM