Skip to content

Viewer: optional full-recording background streaming with capped cache #254

Closed

Description

@neuromechanist

User feedback: clinicians (e.g. neurologists reviewing a whole recording) want the full recording loaded so paging/scrubbing is instant, rather than the current fetch-on-demand per window.

Proposed behavior:

  • Off by default. A gear toggle ("Preload full recording") persisted client-side (localStorage alongside other viewer preferences — no server state needed; a cookie would needlessly ride every request).
  • When on: keep serving the visible window first (unchanged), then continue fetching the remainder of the recording in the background at the current view level — idle-time, low-priority, sequential from the playhead outward, so interactive fetches always win.
  • Memory cap: in-memory chunk cache with LRU eviction, default 500 MB, exposed as a setting (e.g. 250 MB / 500 MB / 1 GB). The cap bounds the preloader; when full, preloading stops rather than evicting what the user is looking at.
  • Open question: preload at level 0 (full resolution) or at the current pyramid level? Recommendation: current level first (that is what scrubbing hits), optionally level 0 for the region around the playhead.

Implementation notes:

  • store.ts currently reads window chunks on demand; this adds a background scheduler + a byte-accounted cache in front of the zarr fetches.
  • Must respect AbortController on unmount/navigation (eeg-viewer: superseded and closed mounts leave zarr fetches in flight #208) and pause when the tab is hidden.
  • Progress affordance: the timeline scrubber can shade the buffered region (like video players), which also communicates the feature exists.

Activity

  1. added
    enhancement
    feature
    on Sep 1, 2026
  2. neuromechanist commented on Sep 1, 2026

    @neuromechanist
    ContributorAuthor

    Shipped in PR #259, merged to staging via epic PR #270 (merge commit 9e047c1). Closing by hand: closing keywords only fire on the default branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfeature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions