Engineered for infinite scrolling feeds, mobile applications, and high-frequency real-time updates. Eliminates page drift and prevents duplicate items when new records are continuously added to the top of collections.
Fetch initial slice, or test passing an opaque _cursor token:
GET /posts?_limit=5Understand the trade-offs between traditional offset numbering and modern opaque cursors:
| Evaluation Metric | Offset Pagination (?_page=2) | Cursor Pagination (?_cursor=...) |
|---|---|---|
| Page Drift Vulnerability | High. If a new post is inserted while reading page 1, item #10 shifts to page 2 and is seen twice. | Zero. Pointer anchors to the exact record boundary regardless of new items created above. |
| Database Query Performance | Degrades at scale (OFFSET 50000 scans and discards 50,000 rows). | Instant O(1) indexed seek (WHERE id < cursor LIMIT 10). |
| Direct Page Number Jump | Supported. Users can jump directly to "Page 14" via table pagination bars. | Sequential only. Ideal for infinite scrolling, feeds, and "Load More" buttons. |
| Payload Signature | { total, totalPages, page, limit } | { nextCursor, hasMore, limit, total } |
Production patterns for TanStack Query Infinite and custom React feeds: