Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add local history cache and storage port#2

Open
zealsprince wants to merge 4 commits into
mainfrom
local-cache
Open

Add local history cache and storage port#2
zealsprince wants to merge 4 commits into
mainfrom
local-cache

Conversation

@zealsprince

@zealsprince zealsprince commented Jun 14, 2026

Copy link
Copy Markdown
Member

Local History Cache & Storage

This PR introduces a comprehensive local caching system for message history across all Orbit clients. It covers the full specification for on-device persistent caching, including progressive rendering, platform-specific implementations (IndexedDB on web, SQLite on desktop), and a user-facing storage management interface.

What this means:

  • On-device persistent cache (IndexedDB on web, SQLite on desktop) that caches all messages the client has seen
  • Cache-first prefill - buffers open instantly from disk, with network reconciliation filling only the delta
  • Progressive rendering - large buffers mount incrementally to keep the main thread responsive
  • Sliding window pagination - users can scroll arbitrarily through cached history while keeping the DOM bounded
  • Storage management - Settings -> Storage UI showing per-buffer stats, eviction controls, JSON export, and configurable per-buffer caps

Why This Matters:

  • Massively reduces server load by serving scrollback from disk instead of repeated chathistory requests
  • Messages persist beyond the server's retention window, giving each client its own incremental archive
  • Foundation for client-side search indexing (upcoming follow-up)
  • Enables reconnection deltas instead of full re-pulls
  • Maintains IRC's trust model - caches only what the server delivered, keyed by server-asserted msgid

Platform Differences

Aspect Web (IndexedDB) Desktop (SQLite) Widget
Storage Quota-bounded, best-effort Unbounded, persistent Ephemeral in-memory
Persistence Survives browser eviction (with persist() opt-in) Full archive Session-only
Practical role Fast accelerator + recent history Durable personal archive Read-only recent

See the full spec in spec/04-clients/04-local-cache.md for implementation details, configuration constants, and honest environment constraints.

Comment thread spec/04-clients/04-local-cache.md
Comment thread spec/04-clients/04-local-cache.md
@zealsprince

Copy link
Copy Markdown
Member Author

Added edits to the spec and expanded by adding statuses like joins and parts to the history as well.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants