Skip to content

Eager load featured images#498

Merged
LukeTowers merged 1 commit into
rainlab:masterfrom
nizzac:eager-load-featured-images
Apr 20, 2020
Merged

Eager load featured images#498
LukeTowers merged 1 commit into
rainlab:masterfrom
nizzac:eager-load-featured-images

Conversation

@nizzac
Copy link
Copy Markdown
Contributor

@nizzac nizzac commented Apr 20, 2020

Loads in featured images in the Posts component loadPosts method

Loads in featured images in the Posts component loadPosts method
@bennothommo
Copy link
Copy Markdown
Contributor

@LukeTowers @nizzac Hmmm, I think this should be optional. We've just effectively added another SQL query to everyone regardless of whether they use the images or not.

@LukeTowers
Copy link
Copy Markdown
Contributor

@bennothommo I think it's fine given that we already have a potentially unnecessary query for those that don't use categories, and a single query being added on a site that doesn't use featured images (so presumably pretty light weight already) seems like it would outweigh the performance improvement for sites that do utilize featured image as it removes a query for every post displayed on a page at once.

@bennothommo
Copy link
Copy Markdown
Contributor

@LukeTowers fair, but I'd be more inclined to make the categories optional too, perhaps as component parameters :)

@LukeTowers
Copy link
Copy Markdown
Contributor

Fair enough @bennothommo, perhaps you could make a PR for it and have it default to eager loading to preserve existing behaviour?

@bennothommo
Copy link
Copy Markdown
Contributor

@LukeTowers will do :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Completed Fix is completed and merged into the dev branch; remaining open until it has been merged into master Type: Maintenance Minor maintenance to the code base (i.e. minor bug fixes, styling fixes, translation improvements)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants