Closed 8thgencore closed 11 months ago
Hello @8thgencore I agree it seems a good idea I am going to work on that the next days
I also noticed that if we get a list of users from the server (for example, 50 people). Then for each of them there is a request to s3 storage to form a link to the image. This greatly affects the speed of data acquisition. I am now also thinking how to speed up this process
Hello, @8thgencore that is a good insight do you have a sample code to replicate it?
Hello @8thgencore in this commit you can find how to combine pydantic models for what you are trying to do with image it uses root_validator https://github.com/jonra1993/fastapi-alembic-sqlmodel-async/commit/be0b363badd27976b0c6db147ebd4c24022d62b0
Image without media just link
This still grabs a link for every single item, if you needed to grab 100 users, there would be 100 seperate requests to minio to grab fresh links. I was thinking perhaps this could be stored in redis for faster retrieval, and expiration between minio urls and redis could be synchronized to expire at the same time. Otherwise, is it possible to make some kind of schema validator that looks at all the file paths and asks minio for a link on all of them at once, which can then be mapped back across the responding schema?
Hello @bazylhorsey if you want to get faster responses I see 2 options
Now we get the user like this
But the image object takes up a lot of information.
This is especially clearly seen when we get a list of users and unnecessary fields are inserted.
it happens that need when only the url is needed from the image.
Example:
It would be nice if there was an alternative scheme.