-
perf(ui): eliminate full listBooks() scan on every page load
Some checks failedRelease / Test backend (push) Failing after 10sRelease / Docker / backend (push) Has been skippedRelease / Docker / runner (push) Has been skippedRelease / Docker / caddy (push) Failing after 10sRelease / Check ui (push) Successful in 32sCI / Test backend (pull_request) Successful in 39sCI / Check ui (pull_request) Successful in 48sRelease / Upload source maps (push) Successful in 2m17sCI / Docker / caddy (pull_request) Successful in 2m44sRelease / Docker / ui (push) Successful in 2m31sRelease / Gitea Release (push) Has been skippedCI / Docker / runner (pull_request) Successful in 1m38sCI / Docker / ui (pull_request) Successful in 1m28sCI / Docker / backend (pull_request) Successful in 2m11sreleased this
2026-03-26 16:14:47 +05:00 | -253 commits to main since this releaseThe home, library, and /books routes were fetching all 15k books from
PocketBase on every SSR request (31 sequential HTTP calls per request).Changes:
- Add src/lib/server/cache.ts: generic Valkey JSON cache
- Add getBooksBySlugs(): single PB query fetching only requested slugs,
with fallback to the 5-min Valkey cache populated by listBooks() - listBooks(): now caches results in Valkey for 5 min (safety net for
admin routes that still need the full list) - Home + /api/home: replaced listBooks()+filter with getBooksBySlugs()
on progress slugs only — typically 1 PB request instead of 31 - /books + /api/library: same pattern using progress+saved slug union
Downloads