[Feature]: Media Caching (Images, Videos, Audio)
Feature Summary
Feature Request: Optional Persistent Media Caching (Images, Videos, Audio) with Per-Feed and Starred-Only Controls
What problem does this feature solve?
Description: Currently, Miniflux’s built-in media proxy (image_proxy) is very useful for bypassing mixed-content warnings, protecting privacy, and circumventing network restrictions (e.g., GFW blocks on certain media hosts). However, it works as an on-the-fly proxy: media files are fetched in real time and are not persistently stored on the server. If the original media file is later removed or the source becomes unreachable, the media disappears from archived articles. I would like to request an optional persistent media caching feature that downloads and stores media files locally on disk, with the following configurable behaviors to minimize resource usage (especially PostgreSQL load and disk space): Proposed Features
Per-feed media caching toggle Add a checkbox in the feed edit page: “Cache media locally (images, videos, audio)”. When enabled for a specific feed, all media referenced in new articles from that feed will be downloaded and stored on disk during feed refresh. This avoids unnecessary caching for high-volume or disposable feeds.
Star-only caching mode (optional global or per-feed setting) Only cache media when an entry is starred (favorited). When an entry is unstarred, automatically delete its associated cached media files. This is ideal for users who primarily want long-term preservation of important articles.
Persistent local disk storage Cached files stored in a configurable directory (e.g., /var/lib/miniflux/media_cache/ or user-defined path). Media URLs in articles rewritten to point to the local cached copy (similar to how the current proxy works, but serving from disk). Support for images, videos, and audio (same types as the existing PROXY_MEDIA_TYPES option).
Cache cleanup Automatic removal of cached files when the corresponding entry is deleted or unstarred (if using star-only mode). Optional manual “Purge unused media cache” button in settings.
Benefits
Ensures long-term readability of important articles even if original media is deleted. Minimal impact on database size (PostgreSQL only stores the local file path, not the binary). Full control over disk usage via per-feed or starred-only activation. Keeps Miniflux’s lightweight philosophy while adding a highly requested archival capability.
Thank you for considering this feature! Many users (especially in regions with network restrictions or who rely on Miniflux for long-term knowledge archiving) would greatly benefit from it.
Proposed Solution
Proposed Solution Please describe how you think this feature should work: To address the need for persistent media availability (even after original sources delete images/videos/audio) while keeping Miniflux lightweight and minimizing resource usage (especially PostgreSQL load and disk space), I propose the following optional implementation:
- Core Objectives
Allow users to view media in historical entries even if the original files are removed or unreachable. Store cached media files on local disk (not in the database) — only file paths are saved in PostgreSQL to avoid bloating the database. Provide granular controls to prevent unnecessary disk usage.
- Configuration Levels and Toggles
Global setting (in Settings page): “Enable local media caching” (disabled by default). Optional global mode: “Cache all media” “Cache media only for starred entries” (recommended default).
Per-feed control (added to Feed edit page): Checkbox: “Enable local media caching for this feed”. Caching only activates if both the global setting is enabled and the feed-specific option is checked. Ideal for selectively enabling on high-value feeds (e.g., blogs) while disabling on high-volume/news feeds.
- Caching Trigger Timing (Two Configurable Modes) Mode A: Proactive caching (suitable for users with ample disk space)
During feed refresh, if caching is enabled for the feed, download all images, videos, and audio referenced in new entries to local disk. Rewrite media URLs in the entry content to point to the local cached files before saving.
Mode B: On-demand caching (recommended default, resource-efficient)
During normal feed refresh, behave like current proxy (no download). When a user stars (favorites) an entry: Trigger a background job to download all media in that entry. Rewrite URLs in the stored entry content to local paths. Save the updated content.
When a user unstars an entry: Automatically delete associated cached media files. Optionally revert URLs or keep them (show placeholder if file is gone).
- Storage and Cleanup
Cache directory: Configurable path (e.g., /var/lib/miniflux/media_cache/, suitable for Docker volume mounting). File naming: Use hash of original URL (e.g., SHA256) + extension, with subdirectories to avoid too many files in one folder. Automatic cleanup: Delete cached files when the entry is removed. Delete on unstar (if using on-demand mode). Manual “Purge orphaned media cache” button in Settings (scans for files no longer referenced).
Respect existing PROXY_MEDIA_TYPES (image, audio, video).
- User Experience
Seamless for users: media loads automatically (prefer local copy, fallback to original if needed). Optional indicator on entries: small icon showing “media locally cached”. Settings page shows current cache disk usage.
- Benefits
Balances archival needs with resource control — only important (starred) content consumes permanent storage. Minimal database impact (only stores paths). Complements existing image_proxy without breaking current behavior. Keeps Miniflux’s minimalist philosophy while adding a valuable preservation feature.
Alternatives Considered
No response
Additional Context
No response
Checklist
- I have searched existing issues to ensure this feature hasn't been requested before.
- I understand that feature requests are not guaranteed to be implemented.
- I agree to follow the project's contribution guidelines.
Source: miniflux/v2