Closed barrysohl closed 4 years ago
The Firestore API allows you to specify a "source" when querying for a document:
documentRef.get({ source: 'server' }) // or 'cache'
We badly need access this to try to address performance issues we're having with offline access. Is that option available, and I'm just not finding it? Or if not, can it be added?
Hi Barry,
You can set the source to server or cache by specifying the Source.Cache when getting documents: .GetDocumentsAsync(Source.Cache)
Example:
await _firestore.GetCollection(Category.CollectionPath) .OrderBy("order", false) .GetDocumentsAsync(Source.Cache) .ConfigureAwait(false);
That fixed it!!! If I force 'source' to Cache when offline, our launch queries that took minutes are now sub-second. Even faster than when connected. Thanks!
Great news! Glad you got your issue worked out
The Firestore API allows you to specify a "source" when querying for a document:
documentRef.get({ source: 'server' }) // or 'cache'
We badly need access this to try to address performance issues we're having with offline access. Is that option available, and I'm just not finding it? Or if not, can it be added?