media caching should be more aggressive
Describe the improvement
Caching of media is sub-optimal. Whenever I am scrolling in my favorites or bookmarks on various accounts, Fedilab loads the media again... and again... and again... if even a small amount of time has gone by since I last saw it.
For example, I ignored an aesthetic blogging account during 4 days of minimal Fedilab usage, and when I came back and loaded my favorites for that account, none of the media was cached. This includes media for favorites I'd made just 4 days previous. I use favorites & bookmarks extensively for curation, and this makes it a giant pain, particularly on slow servers or slow network links. It also wastes mobile data, which sadly I pay for by the byte in my country.
There's really no good reason other than low available storage to expire cached media for toots where the user has signaled definite interest. If users have the storage free on their device, I believe they would be much better served by lengthening the time Fedilab stores media which they are likely interested in.
Perhaps this could be solved with some form of tiered caching for media?
- Let us assume that user interaction with content is a good rough indicator of interest, and thus of the value of caching it
- Users interact with content in multiple ways: scrolling past, opening to read, opening media, faving, bookmarking.
So, perhaps we could organize tiers by presumed user interest:
- TIER 1 - content which user has posted, faved, or bookmarked, or in which user is mentioned
- TIER 2 - content which user has opened to read (e.g. by expanding a toot or thread) or where user has viewed media (opened video / expanded images)
- TIER 3 - all other content
I propose a minimum cache TTL as follows:
- TIER 1 - 30 days
- TIER 2 - 7 days
- TIER 3 - 3 days
-
Mastodon -
Pleroma -
Peertube -
GNU Social -
Friendica -
Pixelfed