setPersistenceCacheSizeBytes method

void setPersistenceCacheSizeBytes(
  1. int cacheSize
)

Attempts to set the size of the persistence cache.

By default the Firebase Database client will use up to 10MB of disk space to cache data. If the cache grows beyond this size, the client will start removing data that hasn't been recently used. If you find that your application caches too little or too much data, call this method to change the cache size.

This property must be set before calling methods on database references and only needs to be called once per application. The returned Future will complete with true if the operation was successful or false if the value could not be set (because database references have already been created).

Note that the specified cache size is only an approximation and the size on disk may temporarily exceed it at times. Cache sizes smaller than 1 MB or greater than 100 MB are not supported.

Implementation

void setPersistenceCacheSizeBytes(int cacheSize) {
  return _delegate.setPersistenceCacheSizeBytes(cacheSize);
}