Repository navigation
feat(servers): cache featured servers on disk and refresh them in the background - #68
Merged
notchyves merged 1 commit intoNov 6, 2026
Conversation
… background The featured tab was empty on every launch until Xbox sign-in, the featured API call and every logo download had finished, one logo at a time with an 8 s timeout each. A failed call left it empty. The list and its logos are now kept in <data>/featured (servers.json and logos named by url hash) and shown at once. Every launch and every visit to the tab refreshes them in the background; the network list replaces the shown one as soon as it arrives, logos follow in parallel, and a failed call keeps the cached list.
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.
Problem
The featured servers tab starts empty on every launch.
Perlin::RefreshFeaturedonly kept the list in memory, for 10 minutes. Before showing anything, it had to:SignInSaved);tabFeaturedwas only filled at the very end, so one slow logo held back the whole list. Logos were never stored on disk and were downloaded again each launch. A failed call (network, expired token) left the tab empty.Change
Featured servers now work as stale-while-revalidate:
<data dir>/featured/:servers.json: name, description, host, port, logo URL, ranked, rank;logos/<FNV-1a of the URL>.png. A server that changes its logo gets a new URL, so a cached file never goes stale.RefreshFeaturedof a session loads the cache and its logos from disk, fillstabFeaturedand starts the pings, before any network work.featuredBusystill prevents overlapping requests.logos/, and update the rows' icons;Testing
macOS arm64 Release build, signed-in Microsoft account:
servers.jsonis written with 7 servers (Mineville Zeqa, The Hive, CubeCraft, Lifeboat, MegaSMP, Enchanted, Galaxite) andlogos/with 7 files.7 servers (7 logos) from the cacheat line 7, before Xbox sign-in. The network refresh then logs7 featured serversand replaces the list.