dscgt / recycling_website

Admin website for GT OSWM&R.
0 stars 0 forks source link

Cache data, or store in parent state, instead of retrieving every time #38

Open michaelyfan opened 3 years ago

michaelyfan commented 3 years ago

For example: if I click between the "Manage Routes" screen and the "Route Groups" screen constantly, the app with repeatedly make requests to the database for everything that those two pages contain. Ideally the app only requests when database contents change, and does not request on each individual page load. This could involve a parent state, that includes state for all pages, which "listens" to the database.

michaelyfan commented 3 years ago

Interestingly, if repeatedly loading up the Checkin Records page (which currently retrieves ~50 records) by going to and from it, it seems to perform some sort of caching...if you do it 50 times and expect about 2500 reads, the Firestore console only shows ~250 reads, even though metadata's fromCache is always false.