Mastodon Content Retention Settings

Mastodon administrators can access a content retention tool in the Mastodon web interface (Administration->Server Settings->Content Retention).

This tool has three settings that impact storage usage:

Media cache retention period

This value is blank by default, so it never deletes the remote media cache. Still, all servers hosted by Masto.host have an automated cache deletion that will automatically delete the remote media cache. Please read RE: Mastodon media storage for details.

Administrators of a Mastodon server on Masto.host will probably not notice much of a difference in media usage when setting a value to the ‘Media cache retention period’ unless it’s a low value (lower than 7) because, as explained in the linked post, the most significant media cache (media files in posts) will auto delete in 7 days.

I suggest to anyone on Masto.host to leave this value blank because cache deletion is already in place by default. For administrators outside Masto.host, I suggest using the tootctl CLI or setting this value to 30 days. If someone local attempts to access a deleted file from the remote media cache, Mastodon will attempt to re-download it.

Content cache retention period

This value is blank by default, so it never deletes the remote content cache.

The current Mastodon implementation makes this a dangerous setting and will indiscriminately delete remote content older than the number of days set, whether the content was interacted with or not. This means, that no matter if a local user bookmarked, favourited, or boosted a remote post or even if a post is a remote reply to a local post, all will be deleted once the number of days has been reached, which is irreversible. You can read a discussion I started in the Mastodon GitHub about the consequences of enabling this setting to see if the Mastodon dev team finds an alternative implementation. Until Mastodon releases an improvement for 'Content cache retention period', I suggest leaving this value blank or, if you want/need to set it, make it something like 730 days (2 years) or higher. However, any value set will still cause data loss.

User archive retention period

This value is seven by default and should not be reduced as that is the number of days a local user has to delete an archive of their data if/when the user requests it.