-1

I have project for managing sport tournaments. It is written in PHP / Laravel. I need to publish match results on webpage asynchronously ("online"), while the tournament is running. I cannot decide, which way of communication is more suitable for my situation. Periodic ajax requests (e.g. 1 request per 10 seconds) or WebSockets? Could you please advise me? Could you please also mention some pros & cons of both ways?

Thank you very much.

1 Answers1

0

If you are using these requests for mobile version also definitely go with websockets cause ajax(http) calls will affect on battery life of mobile and this example will demonstrate that http calls need more energy for work as compare to websockets.

if you don't need the specific benefits that WebSockets provides, then it's probably a better idea to stick with existing techniques like AJAX and Comet because this allows you to re-use and integrate with a huge existing ecosystem of tools, technologies, security mechanisms, knowledge bases (i.e. far more people on stackoverflow know HTTP/Ajax/Comet than WebSockets), etc.

anshuVersatile
  • 2,030
  • 1
  • 11
  • 18