How to update a content of webpage in real time? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to update a content of webpage in real time?

I want to create a view counter for my blogs page. Which means that, whenever someone hits the page, it updates the visitors counts of at all the users using that page without refreshing or reloading the page. How can I achieve? I am building my web app using HTML, CSS, Javascript and PHP and DBMS I am using is MySQL.

3rd Feb 2020, 3:51 PM
Shashank Shekhar
Shashank Shekhar - avatar
1 Answer
+ 1
bluesea Using AJAX is good but wouldn't that put a heavy load on the server if the number of clients accessing the website is large. I mean that suppose I'm periodically updating the page every 2 seconds. Which means that a single user will be sending 30 AJAX calls per minute. If there are 100 users accessing the page then there will be 3000 AJAX calls per minute.
3rd Apr 2020, 12:24 PM
Shashank Shekhar
Shashank Shekhar - avatar