I would like to know how Firebase Realtime Database download works in below conditions:
- Offline persistence is enabled
Database.database().isPersistenceEnabled = true
- App is launched first time. Read the data from the same node in the below order
Database.database().reference().child("foo").child("uid1").observe(.childAdded) { snapshot in
print(snapshot)
}
Database.database().reference().child("foo").child("uid1").observe(.value) { snapshot in
print(snapshot)
}
What I observed are:
- 'childAdded' observer will print the fresh data sequentially
- 'value' observer will then bring the same but at once.
My question is, will the data the value observer brings be from cache in this occasion?
I've seen a few of similar questions(link1, link2) but I am not 100% sure that it is from cache and not fire the server to send the duplicated data. Any help would be appreciated.