1

In most cases I am writing as online, but I am reading as offline(from cache):

db.collection('users/user1/messages').get({ source: 'cache' });

Will the above code will cost me? as I am reading only from cache not server

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Muhammad
  • 2,572
  • 4
  • 24
  • 46
  • See https://stackoverflow.com/questions/56617814/questions-about-firestore-cache-and-reads-charge and https://stackoverflow.com/questions/55202782/does-firebase-charge-for-retrieving-docs-from-firestore-js-sdk-cache – Frank van Puffelen Apr 22 '20 at 15:32

1 Answers1

3

Querying using only the cache using source: 'cache' will never incur any billing. Only document received from the server will cost document reads.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441