Describe the bug
In view/html.go, remote images fetched for HTML email rendering are cached in a sync.Map (remoteImageCache) that never expires or evicts entries. Each unique remote image URL adds a base64-encoded PNG to the cache permanently.
For users who read many HTML emails with unique remote images (newsletters, marketing emails), memory usage grows unbounded over the session lifetime.
To reproduce
- Read many HTML emails with remote images (newsletters, etc.)
- Monitor memory usage of the matcha process over time
- Memory grows with each new unique image URL and never decreases
Expected behavior
The remote image cache should have:
- A maximum entry count or total size limit
- LRU eviction when the limit is reached
- Or time-based expiration (e.g. clear after 30 minutes)
OS
All platforms
Describe the bug
In
view/html.go, remote images fetched for HTML email rendering are cached in async.Map(remoteImageCache) that never expires or evicts entries. Each unique remote image URL adds a base64-encoded PNG to the cache permanently.For users who read many HTML emails with unique remote images (newsletters, marketing emails), memory usage grows unbounded over the session lifetime.
To reproduce
Expected behavior
The remote image cache should have:
OS
All platforms