How does pagination on Reddit's home page work?

﹥>﹥吖頭↗ 提交于 2019-12-07 02:53:32

问题


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.


回答1:


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




回答2:


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;


来源:https://stackoverflow.com/questions/3796468/how-does-pagination-on-reddits-home-page-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!