[英]Ajax request vs Persist connection
We are developing a sport live score website. 我们正在开发体育实时比分网站。 From performance view which of these options are better? 从性能角度来看,以下哪个选项更好?
1- Clients send ajax request every 1-2 seconds to server for live plays and their scores. 1-客户端每1-2秒向服务器发送ajax请求以获取实时播放及其乐谱。
2- Using a persist connection library like WebSokcet or Laravel Broadcasting (or anything if better) and push any events to all clients? 2-使用持久连接库(例如WebSokcet或Laravel Broadcasting)(或更好的方法)将事件推送给所有客户端吗?
Push notification is much better but as my previous experience you should pay more attention to one critical point and make a decision first: 推送通知要好得多,但是根据我以前的经验,您应该更加注意一个关键点并首先做出决定:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.