Skip to content

Prefetch the curated Dataset grid on idle (fast tab-switch to Dataset) - #149

Merged
aperson30 merged 1 commit into
mainfrom
perf/prefetch-curated
Aug 14, 2026
Merged

Prefetch the curated Dataset grid on idle (fast tab-switch to Dataset)#149
aperson30 merged 1 commit into
mainfrom
perf/prefetch-curated

Conversation

@aperson30

Copy link
Copy Markdown
Collaborator

Fixes the slow Overview/Upload -> Dataset tab-switch.

Diagnosis: the transition itself is cheap (Dataset/Homepage is in the main bundle, not lazy; the curated search is ~0.5s; all 8 curated thumbnails serve 200 in <60ms). The lag is that a client-side navigation surfaces the curated search + ~720KB of thumbnails as a post-click fetch, whereas a full page load folds the same work into the expected page load.

Fix: prefetchCurated() warms the exact curated search + thumbnail URLs (via itemToId, so the cache keys match what Preview requests) on requestIdleCallback after app boot. Runs once per session, swallows all errors. Frontend-only, no backend change.

A full page load of /dashboard folds the curated search + 8 thumbnail fetches
into the expected page load, but a client-side tab-switch (Overview/Upload ->
Dataset) surfaces that same ~720KB fetch as a post-click stall. Warm it on
idle after boot so navigating to Dataset from any tab renders from cache.
@aperson30
aperson30 merged commit 7d3cffa into main Aug 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant