Prefetch the curated Dataset grid on idle (fast tab-switch to Dataset) - #149
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (viaitemToId, so the cache keys match what Preview requests) onrequestIdleCallbackafter app boot. Runs once per session, swallows all errors. Frontend-only, no backend change.