0

I have been using setInterval(function(), ms) everytime I am making a live notification feature in my website but is there any alternative way to make this live notification without sending request every 5 or 10 seconds, depends on what interval you set. Isn't it heavy to send post/get request everytime you need new datas?

rckycls
  • 31
  • 5

1 Answers1

0

yes it would take a lot of bandwidth. for solution: you can either use WebSocket technology or the Long Polling method ..

Click here for Long Polling reference.

Click here for Web Socket reference.

Demonyowh
  • 1,673
  • 1
  • 9
  • 14