Edit: New Stream Chat Edge Infrastructure Reduces Latency by up to 5x
July, 2021 -
For existing customers and anyone evaluating with a Stream Chat free trial, switching to this new edge API infrastructure does not require any complex change. All you have to do is change the base URL of your API endpoint or SDK to the new URL: https://chat.stream-io-api.com/
. API calls using the old URL and the new edge URL will still connect to the same infrastructure and still access the same channels and messages. We invite you to make the switch and take advantage of improved performance today.
As part of our commitment to provide product and engineering teams with the highest-performing chat development tools in the world, we’ve decided to make this infrastructure upgrade available for all Stream Chat plans at no extra charge.
There are various reasons for the slow loading of chat or channel lists.
1. Check the region you are in. Always keep an eye on the locations - At Stream, there is support for Chat in US East, EU West, Singapore, and Sydney.
https://getstream.io/chat/docs/android/multi_region/
2. Possible latency issues - Check your region, if you are in India, choose the app location to be Singapore, this is at your closest proximity and could lead to low latency. If you missed choosing this during app creation, you can create a new app in the dashboard and set the base URL with the following :
// New edge API infrastructure (recommended)
client.setBaseURL('https://chat.stream-io-api.com');
// Set the client server location to EU West region
client.setBaseURL('https://chat-proxy-dublin.stream-io-api.com');
//Set the client server location to US-East region
client.setBaseURL('https://chat-proxy-us-east.stream-io-api.com');
//Set the client server location to Singapore region
client.setBaseURL('https://chat-proxy-singapore.stream-io-api.com');
//Set the client server location to Sydney region
client.setBaseURL('https://chat-proxy-sydney.stream-io-api.com');
3. Timeout error - Possible timeout errors like -> Operation timed out after 3000 milliseconds
- By default, timeout is set to 3 seconds, try to increase the timeout to 6000 ms, and give it a try.
- This could potentially occur due to network issues.
4. Check the filter conditions on the queryChannel. An empty filter will load all the channels and that could potentially take time, based on the number of channels you might have.
- By default when queryChannel does not have any filter and it will match all channels on your application. While this can be OK during development, you most likely want to have at least some basic filtering.
- At a minimum, the
filter
should includemembers: { $in: [userID] }
. - For more filter options, please click here.
Comments
0 comments
Please sign in to leave a comment.