lundi 9 octobre 2017

How to build a Synchronous Webpage lowering the CPU load?

I have Written an ajax request to a PHP page

Code goes like

setInterval(()=>{
   $.get("../auth.php?reqType=1&reqId=2", (data, status)=>{
      renderWebpage(data);
   }

}, 200);

This process updates the webpage for every 200 millisecs by getting data from database as a JSON Object. It renders the webpage.

But this method creates a huge load on CPU and it costs very high to read data so many times.

How can I come over this and how can I make a best webpage having data sync>

Aucun commentaire:

Enregistrer un commentaire