I'm trying to work on optimizing my Firestore reads, and I am gravely confused. First off – I'm not sure caching works at all, but more importantly – simple queries are generating SO MANY READS!
I will describe my queries in these two pages.
Page 1 queries
1. I reference the authenticated user object for a display name
2. At the scaffold, I query a collection and filter by authenticated user id. In this case, 1 document was returned. I also cache this query on the app level.
Next I generate dynamic children on a column. The column contains a component that accepts it's parameters from the dynamic child object (no queries run inside the component). Again, 1 child was generated from the scaffold query.
Page 2 queries
1. On the scaffold I do a Document from reference from a parameter sent from the previous page
In a column, I run a query on a different collection and filter on the page parameter document reference, as well as authenticated user ref. This query also returned 1 document.
If my math is correct, I'm doing 2 queries which each return 1 document, as well as reading the display name. These should all also be cached as you can see.
I published a version to Testflight, and opened the app one page 1, then navigated to page 2. No other interactions, and I then closed the app. This generated a surprising 42 reads in Firestore (5 more cut off to the right of the screenshot).
I have no idea what's going on. 😅