Skip to content

Persist video predictions in a unified media cache and add a cache browser - #126

Merged
govza merged 6 commits into
masterfrom
cache-options
Sep 27, 2026
Merged

govza merged 6 commits into
masterfrom
cache-options

Conversation

@govza

@govza govza commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Cache TTL: clamp HTTP max-age to a 30–90 day window and ignore Expires.
  • Telemetry: log warn/error as plain text so chrome://extensions errors are readable.
  • Video prediction cache: persist Frame Sample predictions per video key, seed the verdict timeline on attach and answer covered samples locally (within 0.25 s). Rows keep forced visibility and model id and are cleared on strictness change.
  • MediaCacheDatabase: replaces ImageDatabase with one DB holding imagePredictions and videoPredictions, both indexed by [hostname+timestamp]. Legacy ImageDatabase/VideoDatabase are deleted on install/update, so the cache starts empty.
  • Options → Cache tab: images/videos grouped by site, paged per site via the compound index, per-item/per-site/all delete. Previews load only on click, so the page makes no network requests on its own.

Test plan

  • pnpm test:unit (652 passing), typecheck, lint
  • Load extension, browse a few sites, confirm Options → Cache lists sites and items
  • Open a site with >25 items, page through
  • Click a preview; remove item / clear site / clear all
  • Update over an existing install and confirm old databases are gone

Cache-Control headers are unreliable for our purposes: no-cache or short
max-age values evicted good predictions, and Expires bypassed any floor.
Video frames no longer carry no-cache metadata so they can persist.
…atabase

Replace ImageDatabase with MediaCacheDatabase holding imagePredictions and
videoPredictions, both indexed by [hostname+timestamp]; legacy databases are
deleted on install/update. Video frame sample predictions are batched per
video key, seed the verdict timeline on attach and answer covered samples
locally within 0.25 s. Rows keep forced visibility and model id, and are
cleared on strictness change.
@govza govza self-assigned this Sep 27, 2026
@govza
govza merged commit 48586e9 into master Sep 27, 2026
4 checks passed
@govza
govza deleted the cache-options branch September 27, 2026 22:33
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