1

I figured out below two methods for updating the webpage on a real-time basis.

1) By using Notification.

2) By calling ajax at some interval.

Notification: You can send real-time notifications to a browser with the help of notification tools like firebase and update data accordingly by calling ajax again or using data received by the service worker.

Interval Ajax: Call ajax in an interval of 1min or in any frequency you want and match new data with the old one for updating changes.

So what's your opinion will these two work?

If yes then which one will work best and if not then what will be the best method for updating the page on a real-time basis without using node.js server.

Smart Manoj
  • 5,230
  • 4
  • 34
  • 59
Nishant Singh
  • 477
  • 4
  • 8
  • Define "best". The two have advantages and disadvantages each, so it would depend on your use-case. – VLAZ Jun 06 '19 at 13:44
  • how is `node.js` related to both your methods ? – YvesLeBorg Jun 06 '19 at 13:47
  • @VLAZ I tried using these methods for updating data for my software panel. Like if I fetched 10 data from the backend and someone updated 1 from these in the background then I have to update data which I fetched earlier. – Nishant Singh Jun 06 '19 at 13:49
  • also define `real-time` : in my opinion, `real` is about the clock of the beholder. What is the context of this page refresh ? – YvesLeBorg Jun 06 '19 at 13:49
  • @YvesLeBorg Application like socket.io, juggernaut uses node.js. So these methods don't require node.js for real-time updates frontend side. And also here real-time means live data from backend to frontend. – Nishant Singh Jun 06 '19 at 13:51

0 Answers0