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
master (If you're a user, don't worry about this).The best would also be to have a task to delete all not necessary files.
Great point!
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.