ctf0 / Laravel-Media-Manager

A "Vuejs & Laravel" Media Manager With Tons of Features
MIT License
829 stars 179 forks source link

Fetching File metadata Architecture #28

Closed ctf0 closed 6 years ago

ctf0 commented 6 years ago

atm in order for laravel to fetch the files info, it will have to make a new request for every piece of info we need for each file.

for example, imagine you have 100 record in a db table & you want to fetch the content of those records,

except in our case, it get data by column not by row, docs

so in-order for the manager to display the file info we need

getVisibility(),
lastModified(),
mimeType(),
url(),
size(),

so those 100 files are essentially 500 + 1 requests, not to mention getting the folders size.

this is a bad architecture and its related to laravel not the media-manager it self, this also renders the manager almost inaccessible for remote disk storages like S3.

Example Case

if anyone knows an idea/solution for this mess, am all ears.

ctf0 commented 6 years ago

it turned out that the FlySystem Api have some methods which aren't in the laravel docs, which allow us to get the file along with its metadata except for a couple of items which isn't possible