Let's say i have a web/mobile app running firebase firestore database.
My app is set to serve mostly dynamic content fully stored in firestore.
So we are talking about caching dynamic content
If a user load Page A, it's will make 1 request to firestore (for example). If this user go to Page B and then go back to Page A 5 minutes later, i don't want the app to make another request if the content has not changed.
I heard about http cache-control
headers but my concern is. If the cache control go check firestore to learn if the content is still the same, will this operation be counted as a request by firestore ?
Firestore does not make requests in a way that HTTP Cache-Control headers would apply.
However, the protocol includes a notion of a resume token which allows entire queries to be resumed at a later time, possibly avoiding the retransmission of any unchanged documents that match the query.
If you enable persistence in your web app, Firestore will cache the documents and resume tokens in a local IndexedDB for you. If you come back to a page later, it will use the resume token transparently and avoid retransmission.
Note a pricing caveat:
So, to specifically address your question. If:
Then Firestore will request the data for the page but the server will essentially respond that nothing has changed: no documents will be transferred and there will be no charge to confirm that.