this post was submitted on 22 Aug 2023
41 points (100.0% liked)

Lemmy Support

4655 readers
23 users here now

Support / questions about Lemmy.

Matrix Space: #lemmy-space

founded 5 years ago
MODERATORS
 

I was getting close to hitting the end of my free object storage so there was time pressure involved haha.

Seems to work but I haven't tested it too much. Currently running on my instance.

you are viewing a single comment's thread
view the rest of the comments
[–] BlackEco@lemmy.blackeco.com 7 points 1 year ago (5 children)

I think the local caching was intentional to reduce load on remote instances, should we disable it?

[–] nick@campfyre.nickwebster.dev 4 points 1 year ago* (last edited 1 year ago) (1 children)

That's why I made it a config option that defaults to true (defaults to caching on).

I think big instances should cache, but for smaller instances with less funding and resources it makes sense to skip the caching.

[–] conorab@lemmy.conorab.com 2 points 1 year ago

This also helps mitigate the risk of people posting CSAM to attack other communities which your instance is subscribed to right? If you instance never cached the image, there's no clean-up you have to do on your end provided the original instance removes the image from their server.

As you've mentioned, it makes sense for larger instances to have a cache, but smaller instance (especially single-user instances) may actually be better off not caching at all and just hosting their own images. As a more long-term solution which can add to this patch, it would be good if Lemmy did 2 things:

  1. Separated the image cache for images from other instances so it can be cleared automatically on a schedule. E.g. Images which are a local cache are deleted after X days. Yes there are proper caching algorithms used in filesystems which would be better long-term, but a quick solution for this is probably better than no solution.
  2. Periodically check for images which were uploaded by your own users to see if they are being referenced by any posts or comments. If not, delete them. I would imagine this could be a fairly intense operation so limiting this more fine-grained approach to images uploaded by your own users and taking the more liberal approach with cached images may help performance.
load more comments (3 replies)