In my android app, I'm using firebase database. For offline work, the following code is used :
FirebaseDatabase.getInstance().setPersistenceEnabled(true);
Data in a reference will remain same. While offline, data in that reference loads without any delay, but while online the same data takes time(around 8 seconds) to get loaded. As there is no change in data in that reference, I want those data to be loaded without delay (may be from cache). How can I do this?