The moose likes Ranch Office and the fly likes Viewed count for any post functionality need to change Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Ranch Office
Bookmark "Viewed count for any post functionality need to change " Watch "Viewed count for any post functionality need to change " New topic

Viewed count for any post functionality need to change

Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 689


I have been observed that if I refresh the post the count of viewed shown below at the end of every post also been increased. I guess the functionality should count only the counts and increase if the users viewed that post first time. There must be having some logic which check IP and increase count.

Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11776

Personally I dislike it when people tell me what needs to happen, especially when they say that it "must be".

As to the overall functionality - we can't just use IP addresses, as many places (e.g. schools, businesses, libraries, ...) use a single IP address, so restricting on that criteria would simply change the problem from one where a topic might have a too high number to one where a topic might have too low a number. In addition, this implies storing data on the server side on what pages every visitor (signed in or not) has viewed for all time - the potential database table would be huge. There are worse problems to consider if you try to save that information client side.

I'm don't see this as a high priority, especially given the complexity involved in getting accurate counts and the relatively low value in trying to get them accurate. It is not like there is any competition to see which topics are viewed the most.

The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

I also don't think it is currently wrong. It says # page views, not # distinct people who read it. If I click on this thread every day for 5 days to see new posts, that's 5 views. Not 1 view.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Viewed count for any post functionality need to change
jQuery in Action, 3rd edition