Cache the merged media catalog and trim card rendering

This commit is contained in:
Fisto
2026-09-21 10:52:18 +02:00
parent 41732bd96f
commit 6761a2192e
5 changed files with 116 additions and 5 deletions
+8
View File
@@ -40,6 +40,14 @@ mobile draft at 390px.
- [x] C11 preview caching: Discord-hosted image/GIF previews (WebP 320px, hash-addressed, 5 MiB
cap, one attempt) run after every walk in both modes. Live run `...-20260916090722`:
`previewed: 2`; thumbs served over `/api/media/<scrape>/<item>/thumb` (200).
- [x] C61 Media browsing performance. The grid's merge step rescanned every scrape database per
request (about 300 ms for a page, 250 ms for stats, both refetched on every scroll append).
`MediaService` now keeps a candidate cache keyed by a scrape revision plus the normalized
filter shape (paging and empties dropped): one scan per filter set, then ~5 ms per page, and
stats share the scan. The client skips stats when the filters are unchanged (60 s TTL), updates
only the pager instead of rebuilding the toolbar on page loads, and renders tiles with
`content-visibility`/`decoding=async`/low fetch priority. Measured: 302 ms first page, 5 ms
later pages; smoke test streamed 2,480 tiles with no console errors.
- [x] C60 Incremental re-scrapes and archive cleanup. A new scrape of a channel that already
has a completed walk now starts after that walk's newest message (the best completed scrape by
message count), so it only covers the newer gap instead of re-fetching history; the previous