Nick Gammon said: Well, to keep track of *unread* posts, every time a new post was made, you would have to add 4,905 records (at present), for maybe 3 or 4 posts a day. This would significantly add to the time to make a post. A problem too is that a lot of users may be dormant.
Sorry, I must not have phrased my idea correctly... what I meant is that you don't need to track it at the time the post is made, but rather, you can keep track of the last time you synchronized a given user with the unread post list. Then, when the user next visits the site, you update their unread post list with all posts made since their last sync time.
For example:
David's last time sync: Oct 4th. Currently unread: threads 2, 3.
On Oct 5th: David doesn't visit. Thread 1 gets an update, thread 4 is created. (Nothing happens to David's unread post list.)
On Oct 6th: David visits.
- posts made since Oct 4th (time of last sync): threads 1, 4.
- threads 1,4 added to unread list. Current unread list: 1,2,3,4.
This way, you have several advantages:
- You store nothing for dormant users.
- You don't delay individual posts.
- The cost of synchronizing the post list is probably relatively small: you're already doing (almost) exactly that, in some sense, with the current method. Just now, you'd be adding the posts to a list somewhere.
You can store the "last visit" as a cookie, a database field, whatever. (I'd actually prefer the database field, so that it persists across all of my login sessions.)
You would probably want a "mark all posts read" button or something so that somebody can just wipe out the entire list. Maybe "mark posts read" per forum section, too.
Does that make more sense? |