Private
Public Access
Use keyset pagination for the stream (C4)
The stream did a COUNT(*) and OFFSET slice on every request, ordered by a non-unique (published_at, fetched_at) — deep pages got slower and articles sharing a timestamp could repeat or vanish across pages. It now orders by (Coalesce(published_at, fetched_at), id) and pages with before/after cursors, fetching one extra row to know whether another page exists instead of counting. Pagination links also keep the feed scope, which the old links silently dropped. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
70b0d4f277
commit
8d2900424a
3 files changed
+156
-16
No files matched your search
@@ -10,10 +10,10 @@
|
||||
</ul>
|
||||
|
||||
<nav class="pagination">
|
||||
{% if has_previous_page %}
|
||||
<a href="?filter={{ active_filter }}{% if active_tag %}&tag={{ active_tag.pk }}{% endif %}&page={{ page|add:"-1" }}">← Newer</a>
|
||||
{% if has_newer_page %}
|
||||
<a href="?{{ newer_qs }}">← Newer</a>
|
||||
{% endif %}
|
||||
{% if has_next_page %}
|
||||
<a href="?filter={{ active_filter }}{% if active_tag %}&tag={{ active_tag.pk }}{% endif %}&page={{ page|add:"1" }}">Older →</a>
|
||||
{% if has_older_page %}
|
||||
<a href="?{{ older_qs }}">Older →</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
Reference in new issue
Block a user