Pregunta

I'm currently a firebase customer and is facing this pretty bad performance problem in firebase: Firebase load performance where the initial websocket handshake delays the loading of the entire app by a second or more.

I'm curious if goinstant has this problem solved? The idea is that you make a traditional xhr first and then swap into websockets as the connection is established.

¿Fue útil?

Solución

That's exactly what GoInstant does. It starts with an XHR connection, then attempts to upgrade to websocket if available.

Otros consejos

Normally Firebase starts with a websocket. After measuring, we've found it to in general be more reliable and have better performance characteristics, especially for uploads. However, if websockets are unavailable or are failing, the client will use long-polling. XHR requests have some drawbacks. They are not always available cross-domain, and if you have multiple tabs open communicating with the same server, some browsers will limit the available sockets, forcing tabs to take turns polling.

You can, if you want, force Firebase to use long polling by calling Firebase.INTERNAL.forceLongPolling();

Regarding the linked question, we will investigate what's going on (please email support at firebase.com if you haven't already), as those measurements are definitely higher than they should be and are somewhat atypical.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top