Skip to content

BUG: Body cache has no max size or LRU eviction #1171

@andrinoff

Description

@andrinoff

Describe the bug

config.SaveEmailBody writes every fetched body into ~/.cache/matcha/email_bodies/ and never evicts. After a year of heavy use the cache hits hundreds of MB / GB; on small SSDs (laptops, Raspberry Pi) this is a real quota issue.

Expected behavior

Configurable cap (default 500 MB?) with LRU eviction. The existing PruneEmailBodyCache only prunes by UID set, not by size.

Why it's hard

LRU eviction needs an access log persisted alongside each entry, and the eviction has to be safe against concurrent reads. Doing it right means a tiny SQLite-backed metadata sidecar.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions