Stackoverflow is celebrating 10 Million Questions. Congratulations!
Providing us this link: https://stackoverflow.com/10m
There are 3 counters displayed, and the number of each counter is increasing fast and not static.
However, I don't see any AJAX requests for displaying the recent result of each counter.
I got such a counter in our forum as well, but to get the number of recent posts, I do an AJAX request every 3 seconds, running the query SELECT MAX(id) AS total_posts FROM forumposts
to display.
I know, this is not the best solution we have, and it will be not correct anymore if a post is deleted. Using the SELECT COUNT(id)
command is too slow, since we have also more than 10 million posts.
So, how Stackoverflow is displaying the increase of their counters without any requests? It seems to be a nicer solution for me and I'd like to use it for our forum as well then.