I wanna build a view counter functionality for my website just like here on stackoverflow view counter: View counter functionality in stackoverflow I know how to build that, each time a user hit the post url, increment its view times by one. But the problem is that a user can come and refresh the page as much as he wants. How to fix that? any suggestion? I will be really glad if you can tell me the algorithm or code of that.