How does pagination on Reddit's home page work?
Asked Answered
C

2

6

Reddit uses a time decay algorithm. That would mean the sort order is subject to change. When a user goes to page 2, is there a mechanism to prevent them from seeing a post that was on page 1 but was bumped down to page 2 before they paged over? Is it just an acceptable flaw of the sort method? Or are the first couple of pages cached for the user so this doesn't happen?

Side note: It's my understand that Digg cannot suffer from this issue but that HackerNews and Reddit can.

Catamaran answered 26/9, 2010 at 3:15 Comment(2)
This isn't unique to systems like Reddit - any system that orders by 'newest' has the same potential issue.Acidulous
A note to anyone who wasn't aware that Reddit is now open source. You can view the source on GitHub.Ileostomy
A
5

From the next URL you see: http://www.reddit.com/?count=25&after=t3_dj7xt

So clearly the next page ensures that the page2 starts at the post after t3_dj7xt - whatever that translated to. This could be accomplished using IDs so you'd pass after=188 then the next page starts at 189 thus ensuring you don't see the same post if a time delay occured

Azral answered 27/9, 2010 at 0:11 Comment(2)
I noticed that. Though that leaves the possibility that you are missing posts that in that time were promoted to appear on Page 1. You are essentially skipping to after post t3_dj7xt, even if at this point that post would be on the second page.Catamaran
But technically that is the correct way to handle it. I would expect that page 2 will always show the page 2 at the time I requested the original page. If I want to see the most recent I just refresh or hopefully press the "2 more posts" button akin to Twitter etc... I never liked pressing page 2 and have it appear to be page 1 since I never refreshed the page ;)Azral
P
0

It might be using the last ID as opposed to limiting from. Take these two examples of SQL:

SELECT * FROM Stories WHERE StoryID>$LastStoryID;

rather than:

SELECT * FROM Stories LIMIT 20, 10;
Paneling answered 27/9, 2010 at 0:2 Comment(1)
So you can miss some stories in the process if the sort order has changed and the $LastStoryID would not be on Page 2.Catamaran

© 2022 - 2024 — McMap. All rights reserved.