Mastodon: missing.png repeated

Created on 26 Apr 2017  路  7Comments  路  Source: tootsuite/mastodon

missing.png, the default avatar, appears to be copied _per user_ instead of having one copied referenced multiple times. This is problematic because it takes up unnecessary storage space and weakens the effectiveness of caching, especially over CDNs.

Reported here: https://computerfairi.es/@squirrel/129374


  • [x] I searched or browsed the repo鈥檚 other issues to ensure this is not a duplicate.
  • [AFAIK] This bug happens on a tagged release and not on master (If you're a user, don't worry about this).
bug

All 7 comments

The best would also be to have a task to delete all not necessary files.

Great point!

  1. Option one: remove avatar from Atom feeds if it's missing. Other instances will use their own missing.png for display instead
  2. Option two: keep as is if you want to see the missing.png-esque picture other instances might have customized

I'm more for option two, but couldn't we know that the avatar in question is the default one? For instance another element in the atom feed ?

Option 2.1: Keep ONE missing.png PER instance and then refer to it all the remote users from that instance without avatar.

Also for sane of sysadmins maybe save it to instance_fqdn/missing.png or missing_instance-fqdn.png ?

I don't have a great idea for how to do this, but something at the paperclip/storage level which was like "if two files have the same name and the same size and the same md5sum, just store one copy" would be pretty useful here.

For now though, I actually think continuing to store every image maybe coupled with some "delete things we haven't needed in a while" rake task, is probably fine.

The solution to both this and #2317 is to abstract MediaAttachment slighty further by having it refer to another table that would store the actual files, independently of any associated accounts, with a file fingerprint. Then periodic task to clean orphaned records.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Lewiscowles1986 picture Lewiscowles1986  路  3Comments

renatolond picture renatolond  路  3Comments

golbette picture golbette  路  3Comments

almafeta picture almafeta  路  3Comments

marrus-sh picture marrus-sh  路  3Comments