Reputation: 237
I am hitting quota limits just doing simple dev testing on one box/browser and wondering why Firestore wasn't figuring out that my data hasn't changed between full-collection reads, which should be easy to determine via a timestamp or counter - but it seems that it is doing this.
The issue is that I have verified that the the only returned snapshot (of the unchanged collection) has meta-data of fromCache:true, and I can also see in the Network tab that the offending data is not being transferred from the server.
However, each query (F5 page refresh, etc.) is apparently counting against my quota, which currently means I can only update my code (hot-module-reload) or refresh some other way about 8 times a day, as I'm doing a full read of one particular 3K doc sized collection on startup, along with smaller subscriptions as the app proceeds.
The docs say that cached reads should not count against the quota -- what am I missing?
Upvotes: 0
Views: 280
Reputation: 237
See last comment -- it appears that cached queries may count against quotas if you are using the free Spark plan.
Upvotes: 0
Reputation: 1537
This behavior may be due to various factors such as the methods you are using as well as the cache settings you have for Firestore. For example, by default get() will always attempt to get the information from the server and if it can't it would use the cache. This is mentioned over at here.
It is hard to give more punctual advice as you did not share any code, however, I would recommend you to check the information here in order to get the data offline as well as other answers on Stack such as this one which has a very good explanation on these kind of behaviors.
Hope you find this useful.
Upvotes: 1