-1

Right now i'm using Firebase Realtime Database, is there a way to see if i'm reading data from the Realtime Database or from cache ?(i want the same way like .isFromCache() from https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/SnapshotMetadata).

i read from other stackoverflow question Does Firebase cache the data?, that when i use once(), it clears the cache. is there any way to track where i'm reading the data ?

  • Answer below. But it sounds a bit like a [XY problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). It may be best to also tell us the reason you want check where the result came from, so that we can potentially help coming up with a workaround. – Frank van Puffelen Sep 06 '22 at 04:05

1 Answers1

0

There is no way in the Realtime Database API calls or results to see whether a resulting snapshot came from the cache or from the server.

The isFromCache method from the Firestore API is not available on Realtime Database. It also doesn't necessarily do what you expect it to do, but that seems besides the point here.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807