How to disable get/stream data from cache on firestore?
I saw this article. this feature is by default enable PersistenceEnabled
Is it a clear cache in this way?
void main() async {
await Firebase.initializeApp();
await FirebaseFirestore.instance.clearPersistence();
OR
Is it need to add to every query?
Future<List<BookModel>> _getBooks() async {
await FirebaseFirestore.instance.clearPersistence();
return _db.collection('books')...
}
OR
How to disable cache on firestore all time?
Is it correct?
void main() async {
await Firebase.initializeApp();
FirebaseFirestore.instance.settings =
Settings(
persistenceEnabled: false,
cacheSizeBytes: ?,//is it need add this fields too?
host: ?,
sslEnabled: ?
);