Eager load featured images#498
Conversation
Loads in featured images in the Posts component loadPosts method
|
@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. |
|
@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. |
|
@LukeTowers fair, but I'd be more inclined to make the categories optional too, perhaps as component parameters :) |
|
Fair enough @bennothommo, perhaps you could make a PR for it and have it default to eager loading to preserve existing behaviour? |
|
@LukeTowers will do :) |
Loads in featured images in the Posts component loadPosts method