perf: optimize tag fetching with single-trip combined batch and daemon caching #92

Merged
clanker merged 1 commit from feat/tag-fetch-optimization into main 2026-10-15 04:25:54 +00:00
Member

Summary

  • Combine total and unread thread counts into a single notmuch count --batch invocation in ned.service.get_all_tags(include_unread=True).
  • Support include_unread query parameter on GET /api/v1/tags, returning unread_count alongside total count.
  • Add daemon-side memory caching with 60s TTL for tag counts, automatically invalidated on mail mutation/sync events.
  • Update lazarus.tag.TagModel.refresh() to retrieve both total and unread counts in a single network round-trip when available, cutting remote Tailscale latency in half and eliminating secondary round-trips.
### Summary - Combine total and unread thread counts into a single `notmuch count --batch` invocation in `ned.service.get_all_tags(include_unread=True)`. - Support `include_unread` query parameter on `GET /api/v1/tags`, returning `unread_count` alongside total `count`. - Add daemon-side memory caching with 60s TTL for tag counts, automatically invalidated on mail mutation/sync events. - Update `lazarus.tag.TagModel.refresh()` to retrieve both total and unread counts in a single network round-trip when available, cutting remote Tailscale latency in half and eliminating secondary round-trips.
Sign in to join this conversation.
No reviewers
No labels
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
Home/lazarus!92
No description provided.