Mobile app version of vmapp.org
Login or Join
Sarah324

: The stateless nature of HTTP is going to make it difficult for you to get an accurate picture of how many users are viewing your site's content at a given time - a user may have downloaded

@Sarah324

The stateless nature of HTTP is going to make it difficult for you to get an accurate picture of how many users are viewing your site's content at a given time - a user may have downloaded content from your site and be in the process of reading that content even if the content were downloaded minutes or hours ago.

One way to track how many users are actively browsing your site would be to create a server-side session for every hit - this method would not be ideal for high traffic situations if your server is already short on resources, given that each session stored on your server will require additional resources. The session timeout would also inevitably exclude users who are still viewing a piece of content beyond the window of the session timeout.

The most effective way to see how many users have your content in an open window at a given time would be to add a Javascript timer to your content and, with that timer, make a small request - preferably to a secondary tracking server - every few seconds to indicate that the user is still viewing content from your site.

I am not aware of any commercial services which implement real-time tracking in this manner, however, it would not be too difficult to put together your own if you are comfortable with asynchronous Javascript and a server-side scripting language.

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Sarah324

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme