Keep a running cache of viewport windows and fetch ahead of the reader
- github
- github/openchronology/timeline-app
- commit
- main
- github/athanclark
Server timelines and desktop files kept one overscanned window: any pan past a quarter span, any zoom across a resolution level, or any return to an earlier view queried again. The viewport cache now keeps up to 16 windows (24 MiB) at several resolutions, answering a view from any fresh window of its resolution that covers it; a window replaces the ones of its resolution it contains. Once the view settles, windows ahead of the reader are fetched one at a time: a wide window at the view's resolution for panning, and one level coarser and finer for zooming, ordered by the latest motion and kept within the server's response limit. The view's own query goes first (a web prefetch is aborted; a native one is waited for). Prefetches carry `prefetch: true`, which servers and the desktop store ignore. Over budget, the windows farthest from the view (in octaves, widths and minutes unused) are released first, never those serving the view; windows unused for five minutes go, and a hidden page keeps only the windows covering its view. While fetching, the window last drawn stays on screen if it overlaps the view, else the closest covering one stands in. Closes #53 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/openchronology/timeline-app/commit/c3b04c3ff3ede443661293f6db8f6a78d15f7540
Related
Open Keep a running cache of viewport windows and fetch ahead of the reader in the timeline