what is the minimum cache expire time for firebase remote config?
By default cache expiration time set to 12 hours.
Hitting Firebase remote config too many times will put the request on hold.
While you are implementing/testing the functionality you can set it to any value to get the updated result from firebase. However it is not recommended in production mode
You can do something like this.
// cache expiration in seconds
long cacheExpiration = 3600;
//expire the cache immediately for development mode.
if (mRemoteConfig.getInfo().getConfigSettings().isDeveloperModeEnabled()) {
cacheExpiration = 0;
}
// fetch info
mRemoteConfig.fetch(cacheExpiration)
.addOnCompleteListener(this, new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
if (task.isSuccessful()) {
// task successful. Activate the fetched data
mRemoteConfig.activateFetched();
// update Views
} else {
//task failed
}
}
});
There is no minimum cache expiration time recommended by Firebase. However, please note that if the calls to Firebase Remote Config are too frequent then they will be put on hold for some time. This is done to optimize the network usage by Remote Config feature.
To be frank, 10 min is too small a time to set. Remote Config feature should be used for values that you need to change less frequently. 12h (the default) is a good time to set. You can maybe reduce it to 1h. But I'd not advice you to further reduce this time duration.
In case you really need to update your data more frequently, and you do not want your update request to be put on hold by Firebase for some time, you should consider using Firebase Database instead which has no such limit, and is realtime.
Please see https://firebase.google.com/docs/remote-config/use-config-android#throttling - we have updated the documentation.
Default : 12 hours Minimum time you can specify : 5 times per 60 minute window