Cache search results between page navigations #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every search page load re-executes the full pipeline:
Then fused_ids[offset:offset + PER_PAGE] discards all but 10 results. Pages 2+ recompute the exact same fused result set for a different slice.
Fix: Cache the fused result set in memory keyed by (query_text, semantic_flag). On subsequent page loads, slice from cache instead of re-running inference + ANN + fusion.
~20 lines in search.py. A simple dict with a short TTL (30–60s) or a generational counter incremented on reindex.
Benefit: Cuts page 2+ latency from ~60ms to ~0ms. Also guarantees consistent results across pages.
Synced from Codeberg issue #1 — opened by @fluffblankie on 2026-07-04.