Firebase response time is very slow. How to increase the response speed?

I use Firebase to retrieve data and display it on a web page. It almost takes 4 to 5 seconds to get a response, even if there is one entry.

the code:

firebase.database().ref('categories').on('child_added',function(snapshot){ console.log(snapshot.val()); }); 

I even tried to use the value event, but there is no difference.

 firebase.database().ref('categories').on('value',function(snapshot){ console.log(snapshot.val()); }); 
+6
source share

All Articles