Conversation
Notices
-
@Inginsub MRF would let you change media paths immediately as the post arrives onto your instance.
-
@Inginsub But the media reupload task is a costly one, imagine if someone would upload some file that's several megabytes in size, and while the server fetches it, dozens of other users like/repost/reply to the post with it. Some more substantial changes have to be made, maybe a proper remote media caching facility that doesn't just delegate absolutely everything to nginx.
-
@phnt @Inginsub You could probably use openresty with some inline script for that, but there's nothing that indicates who posted the image in the URL, so it'll just work globally (instead of just for users you follow) and then you end up with a bunch of childporn that doesn't get invalidated automatically.
-
@mint @Inginsub This may be a dumb idea, but you could possibly modify the nginx invalidation shell script to move the file to a specific long-term directory and patch the media proxy to also look there. Then if you do some clever atime/ctime stuff you can delete old cached files depending on their age or size with a cron job.
Of course you can do all of that without patching the media proxy and use the default folder, but if you ever wanted to disable that, there could be stale files left in the cache.
EDIT: There's not that much you can do with large file uploads. You could move the cache to a S3 bucket and that would solve the bandwidth limitations, but it will also be really expensive to manage and run. Or you can simply ignore them.
-
@mint @Inginsub You are right, it would need more than just a media proxy patch and a cron job. Didn't think about that. I have some ideas, but most of them aren't ideal.
I'll add that to the never ending pile of pleromer experiments I have in mind.
-
@phnt @Inginsub That said, if one goes this route, apparently there's no need for special scripts since nginx supports that out of box.
https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_store