Skip to content
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

Open
Matvik opened this issue Mar 28, 2018 · 3 comments
Open

Eager loading for images #54

Matvik opened this issue Mar 28, 2018 · 3 comments

Comments

@Matvik
Copy link

Matvik commented Mar 28, 2018

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.

@zxbodya
Copy link
Owner

zxbodya commented Mar 28, 2018

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)

@Matvik
Copy link
Author

Matvik commented Mar 28, 2018

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

@zxbodya
Copy link
Owner

zxbodya commented Mar 28, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants