Skip to content

Decide what happens to orphaned cache entries #5

Done

Description

@arnelirobles

Cache entries are never removed today. That is deliberate for v1: they are small, and deleting the folder is always safe.

But a large site that edits often will accumulate orphans, because the cache key includes the text, so every edit strands the previous recording rather than replacing it.

Not urgent, and worth measuring before solving. A 3.5 second clip is roughly 20KB, so a thousand orphans is about 20MB, which nobody will notice. The question is what a busy news site looks like after a year.

Options, roughly in order of how much I like them:

  1. Delete entries not read for N days, on a schedule. Simple, and the next request regenerates.
  2. Cap total size, evict least-recently-used.
  3. Nothing, and document the folder as safe to delete.

If you pick this up, measure first. A number from a real site beats a policy chosen in the abstract.

Activity

  1. added
    enhancement
    good first issue
    on Aug 15, 2026
  2. self-assigned this
    on Oct 20, 2026
  3. arnelirobles commented on Nov 16, 2026

    @arnelirobles
    ContributorAuthor

    Unpublished and deleted nodes leave files too, not only edited ones. Nothing deletes cache files today.

    Draft PR #36 adds an opt-in age sweep: set CacheMaxAgeDays and a daily job deletes cached files last written longer ago than that. Off by default, so nothing changes unless you turn it on.

  4. arnelirobles commented on Nov 25, 2026

    @arnelirobles
    ContributorAuthor

    Done in #36, released in v0.4.0. Set CacheMaxAgeDays and a hosted service sweeps the disk cache once a day, deleting entries older than that by last write time. Only files named like cache entries are touched. It is off by default. Closing.

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

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions