简体   繁体   中英

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.

2- Using a persist connection library like WebSokcet or Laravel Broadcasting (or anything if better) and push any events to all clients?

Push notification is much better but as my previous experience you should pay more attention to one critical point and make a decision first:

  • for push notification you need for client acceptance and if he decline you will not be able to send them anything. It means your application is affiliated to your clients choice and I think it's not the result that you expect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM