multi-tenant
multi-tenant copied to clipboard
ActivatesDisk further improvements
I'll be adding functionality to disable tenant specific folder operations completely in 5.2; would that suffice in your use cases @AustinMaddox and @CodeSkills ?
It's been a while, but, we're now running multi-tenant version 5.2 and need to address this. In our case, we cannot set website.disk to false and disable tenancy specific folder operations completely in config/tenancy.php because we use S3 to store images uploaded by tenants. We do not use the overrides... things like the config, translations, vendor, etc.
Obviously our AWS bill is still very high due to all the LIST/HEAD requests. Is there anything we can do to solve this?
Originally posted by @AustinMaddox in https://github.com/hyn/multi-tenant/issues/399#issuecomment-436285353
I see a few options:
- Roll your own upload solution.
- PR a fix to this package that reduces overhead; I am not sure where yet as I didn't investigate it. I'm also not available right now to work on the project to alleviate the burden.
- I can optionally also take a look on a freelance basis. Feel free to reach out to me per mail if interested, it's in the composer.json file.
Right now any attention I will give towards the Laravel Tenancy project as a whole will most likely be pointed at tenancy/tenancy and further stabilising hyn/multi-tenant.
In case anyone else is looking for a workaround, this is what I did. I set tenancy.website.disk to false in config/tenancy.php which disables all tenant specific filesystem auto magic and eliminates the excessive requests to S3 outlined in #399.
Then, throughout my project I replaced every instance of this...
Storage::disk('tenant')->put('images/' . $file_name);
With this...
Storage::put(app(\Hyn\Tenancy\Website\Directory::class)->path('images/') . $file_name);
I am having the same problem too. I am using S3 for storage and every pageload takes almost 10 seconds to complete. As soon as I turn website.disk to false everything goes really fast.
Did you guys find any workarounds? (other than the above ofc.)
So it looks like Tenancy doesn't differentiate between public and private disks, all what we have is "tenant" disk. Everything is basically made private which causes everything to be loaded via PHP and most definitively won't work with S3 when the intention is to serve files directly from S3 to the clients. I went with the solution proposed by @AustinMaddox and it works fine. This would be a good addition to Tenancy next version.