-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eager loading for images #54
Comments
if it is question about optimization - it should be possible to create that relation… basically database structure is: and image url generation is not complicated. however this was not considered to be primary usecase for extension(in most cases I remember - there was just one gallery or very rare cases 10s of them… which is not significant) |
In the case of, for example, an online store, there may be many products on one page, and for each product the main photo is displayed. Other variants also happen |
yes, sure I do not argue there are cases for that, it just was not my case ;) btw, for case with store - often for main photo, requirements are different (sizes of previews for example), and contexts where to use it also, are often different… so I have other extension for that - https://github.com/zxbodya/yii2-image-attachment |
There is a problem - because "images" is not a relation, we can not apply eager loading, for example, when displaying several products with their images. So, there will be a number of database queries executed. It is not good.
The text was updated successfully, but these errors were encountered: