TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The Potential Pitfalls of Pagination

17 pointsby bubblehack3r9 months ago

3 comments

slowmovintarget9 months ago
Back in my J2EE days I knocked out a paginator server-side component that constructed a guaranteed ordering of items. This paginator stored its paging state in memcached with a consistent hash for a key in order to share paging indices among similar requests. Staleness was handled with a periodic check for additional result, or cache expiration after a while. The client had to handle the stale check and the &quot;oops, sorry, let me refresh the paged list...&quot; after idle. This was only suitable for roughly half the use cases.<p>It was complex, but it worked. Thank goodness I didn&#x27;t have to deal with infinite scrolls back then.
huem0n9 months ago
Good article, I do wish it would talked about big-O and arbitrary sort orders.<p>Let&#x27;s say there&#x27;s lots of columns&#x2F;fields to sort by. Not quite an arbitrary sort (e.g. can&#x27;t sort by area when given a width and height column) but its still pretty flexible. Is is possible to get a O(1) pagination while avoiding the rolling-shutter problem and deleted-anchor problem?<p>Getting around the deleted-anchor problem with ordered-ID&#x27;s seems like just using ID&#x27;s as a index. Not a bad trick, but seems like it isn&#x27;t generalizable for all different kinds of sorts.
评论 #41292106 未加载
评论 #41292940 未加载
mjcurl9 months ago
I&#x27;ve been facing the issue of shifting data with the eBay browse api. Unfortunately they don&#x27;t offer ID based pagination. What&#x27;s the best way to deal with it, manually track queried data yourself?
评论 #41292150 未加载