Skip to content

docs(design): adaptive client cache eviction policy (#23)#322

Merged
justin13888 merged 1 commit into
masterfrom
docs/adaptive-sync-23
Jun 3, 2026
Merged

docs(design): adaptive client cache eviction policy (#23)#322
justin13888 merged 1 commit into
masterfrom
docs/adaptive-sync-23

Conversation

@justin13888
Copy link
Copy Markdown
Collaborator

What

Documents the adaptive client-side caching / eviction policy requested in #23. Per the maintainer's updated scope on that issue, this is documentation only — implementation is deferred.

The three asks from #23 are now explicitly specified:

  • Cache previously-viewed content — viewing/opening an asset stamps a last-access time, so recently-browsed assets survive reclamation (scroll back on a high-latency/metered network hits cache, not the network).
  • Evict by last use (LRU) — when over budget, representations are evicted least-recently-accessed first.
  • Evict in tier-size order (Original → Preview → Metadata) — within a sweep, eviction proceeds original → preview → thumbnail; the metadata tier (sidecar + LQIP) is tiny, canonical, and effectively never reclaimed.

Approach

Extends the existing owner docs rather than adding a new one, to respect the repo's Single-Source-of-Truth rule (filesystem/client.md already owns "space recovery"; download-sync.md owns tiered fetch + connectivity adaptation). No new SSoT owner row, no module-map change.

  • design/filesystem/client.md — "Space Recovery" split into Automatic cache management (user-configurable budget, recency promotion, LRU eviction, tier order within a sweep, pin exemption, transparent re-fetch) and User-driven reclamation. Adds four unit-tier validation cases.
  • design/import/download-sync.md — "Prefetch and Frugality" cross-links recently-viewed retention to the owner doc (mechanism mention only; no restatement).
  • DEFERRED.md — records the policy as specified-but-not-implemented, with its seam (capsule-core::db last-access tracking + capsule-core::library sweep, driven by capsule-sdk connection-class detection).

Verification

  • astro build passes; starlight link validator reports all internal links valid (46+ pages).
  • SSoT check: the eviction ordering lives only in filesystem/client.md; download-sync.md links to it.

Refs #23 (left open to track implementation).

Specify the automatic, bounded client cache the issue asks for: cache
recently-viewed assets, evict least-recently-accessed first, and within a
sweep evict in tier-size order (original -> preview -> thumbnail), leaving
the metadata/LQIP tier effectively never reclaimed.

Extends the existing owner docs rather than adding a new one (SSoT):
- filesystem/client.md Space Recovery: split into automatic cache management
  (budget, recency promotion, LRU, tier order, pin exemption) and user-driven
  reclamation; add unit validation cases.
- import/download-sync.md: cross-link recently-viewed retention to the owner.
- DEFERRED.md: record that the policy is specified but implementation is
  deferred, with its capsule-core::db / capsule-sdk seam.

Implementation deferred per the issue's updated scope (documentation only).
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying capsule with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9be8350
Status: ✅  Deploy successful!
Preview URL: https://567d24fe.capsule-22k.pages.dev
Branch Preview URL: https://docs-adaptive-sync-23.capsule-22k.pages.dev

View logs

@justin13888 justin13888 merged commit 0014561 into master Jun 3, 2026
2 checks passed
@justin13888 justin13888 deleted the docs/adaptive-sync-23 branch June 3, 2026 02:55
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.

1 participant