Periodic OnlyOffice cache eviction (no manual rm needed) #13

Open
opened 2026-04-27 07:31:37 +00:00 by zaelgohary · 0 comments
Member

Symptom

OnlyOffice's /var/lib/onlyoffice/documentserver/App_Data/cache/files/data/ grows without bound. Every distinct doc_key leaves an Editor.bin + origin.<ext>. Across weeks of dev + multiple users, this eats disk silently. Manual rm -rf is the only current cure (and it's documented as a poisoned-cache fix, not a maintenance task).

Cause

No automatic eviction policy. OnlyOffice itself doesn't manage cache lifetime — the host system is expected to.

Proposed fix

Periodic prune, either in hero_office_server (background task, runs hourly) or as a hero_proc job spawned by service_onlyoffice.nu. Policy:

  • Walk App_Data/cache/files/data/<key>/
  • For each entry, look up (context, filename) from the doc_key map; if the source file's mtime is older than N days (default 7), delete the cache entry.
  • Log evictions.

Acceptance

  • Cache directory size stays bounded under sustained use.
  • Active documents (recently edited) are never evicted.
  • An "evictable count" + "last-pruned timestamp" surfaces via a new cache_stats RPC method.
## Symptom OnlyOffice's `/var/lib/onlyoffice/documentserver/App_Data/cache/files/data/` grows without bound. Every distinct doc_key leaves an `Editor.bin` + `origin.<ext>`. Across weeks of dev + multiple users, this eats disk silently. Manual `rm -rf` is the only current cure (and it's documented as a poisoned-cache fix, not a maintenance task). ## Cause No automatic eviction policy. OnlyOffice itself doesn't manage cache lifetime — the host system is expected to. ## Proposed fix Periodic prune, either in `hero_office_server` (background task, runs hourly) or as a hero_proc job spawned by `service_onlyoffice.nu`. Policy: - Walk `App_Data/cache/files/data/<key>/` - For each entry, look up `(context, filename)` from the doc_key map; if the source file's mtime is older than N days (default 7), delete the cache entry. - Log evictions. ## Acceptance - Cache directory size stays bounded under sustained use. - Active documents (recently edited) are never evicted. - An "evictable count" + "last-pruned timestamp" surfaces via a new `cache_stats` RPC method.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_office#13
No description provided.