Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Binary Cache & Storage

MovieBox-TUI uses a disk-backed binary MessagePack caching engine to minimize network requests while maintaining fast startup times.

Cache Directory

  • Linux / macOS / Termux: ~/.cache/moviebox-tui/
  • Windows: %LOCALAPPDATA%\MovieBox-Tui\cache\

Override with the MOVIEBOX_CACHE_DIR environment variable.

Binary Cache Architecture

Cache files use a structured MessagePack envelope preceded by a 4-byte magic signature (MBC1):

[ 0x4D 0x42 0x43 0x31 ] [ MessagePack Encoded Envelope ]

The envelope stores the expiration timestamp (expires_at: u64) alongside the serialized payload. On read, if the current time exceeds expires_at or the file age exceeds the TTL, the cache is invalidated and refetched.

Cache TTLs

NamespaceTTLDescription
homepage1 HourTrending, popular, and curated /browse feeds
search24 HoursSearch query results per provider
detailsDynamic (CloudFront TTL)Subject details, cast, and signed streaming cookies (auto-adapts to upstream cookie expiration, min 1h, max 24h)
streamsDynamic (Cookie Expiration)Direct streaming and DASH manifest URLs (auto-adapts to CloudFront-Policy and Edge-Cache-Cookie expiration timestamp :t=, min 1m, max 2h)
captions24 HoursAggregated MovieBox external subtitle lists (primary + sibling dubs, background-prefetched on Details load)
posters30 DaysDownloaded poster image buffers
tv24 HoursRemote M3U playlist text snapshots

Durability & Safety

  • Atomic File Writes: All cache entries write to a temporary sidecar file (.tmp-<pid>-<stamp>) and rename atomically to the destination so interrupted writes never corrupt cache files.
  • Automatic Purging: Stale cache entries older than 7 days are automatically removed by a background worker at startup.
  • Manual Purge: Enter /settings → Maintenance → Clear Disk Cache to immediately wipe all cached files, images, and playlist snapshots.