Cloud Firestore connection is slow on some devices

Viewed 935

Any ideeas why Cloud Firestore connection is slow for my client yet for me is almost instant? The Firebase server selected is europe-west3, my client is in UK and I am in Romania.

He has a relative good download speed, according to speedtest.net, but downloading data from Cloud Firestore is extremely slow. Even 6 documents, with a total of 8 small fields, are loading extremely slow.

3 Answers

Have you checked Firebase Blog Post "Why is my Cloud Firestore query slow?"

I think you should use implement Indexing on your data.

Firebase provides powerful tools for ordering and querying your data. Specifically, Firebase allows you to do ad-hoc queries on a collection of nodes using any common child key.

A node's key is indexed automatically, so there is no need to index it explicitly.

Not sure what might be the reason, but I think it is a great idea to make sure it is initilizing firebase before querying and logging errors.

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(App());
}

Initialize before operations:

await Firebase.initializeApp();

Put above code and operations on try, catch, log and see what happens when it is slow, it might be initializing in the wrong time or not initializing and taking extra time to operate.

The issue was with the browser.

On the same machine, but different browser there weren't any issues.

Related