yii2-gallery-manager
yii2-gallery-manager copied to clipboard
Eager loading for images
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.
if it is question about optimization - it should be possible to create that relation…
basically database structure is:
object with galery --< gallery --< images
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