what is the minimum cache expire time for firebase remote config?
Asked Answered
G

3

9

By default the firebase remote config cache expires after 12 hours, but i want to know what is the minimum cache Expiration time for firebase remote config.

Griceldagrid answered 6/8, 2016 at 9:55 Comment(0)
I
10

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.

Isobaric answered 6/8, 2016 at 15:23 Comment(1)
In debug mode you can set 0 as cache expiration time. It's not throttling in debug and fetches values every time you request itAli
G
3

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
            }
        }
    });
Gromyko answered 28/3, 2018 at 5:40 Comment(1)
5 times per hour as he mentioned?Displacement
A
3

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

Almita answered 6/4, 2018 at 18:0 Comment(3)
The message is gone. Does it valid now?Frigging
Does it mean, 5 times per 60 minute window is allowed at most? And then block if you request more than that? If you have two activities, then 5 times/hour each? What about fragment or dialog, etc?Displacement
firebase.google.com/docs/remote-config/… The new message is here. ". Before SDK version 17.0.0, the limit was 5 fetch requests in a 60 minute window (newer versions have more permissive limits)."Anetteaneurin

© 2022 - 2024 — McMap. All rights reserved.