It seems this has been in the package since 2014 but I just noticed it today while trying to optimize server response times. I noticed that when I asked for with width and height of an image I was generating at least 1 extra query per image.
After reviewing the code it looks like a pretty easy win to disable the query to check if there is a dimension cached for a particular image which is being called regardless of the THUMBNAIL_CACHE_DIMENSIONS setting. This seems counter intuitive to me so I've added an if statement to check for the setting before running extra queries to find dimensions.
It seems this has been in the package since 2014 but I just noticed it today while trying to optimize server response times. I noticed that when I asked for with width and height of an image I was generating at least 1 extra query per image.
After reviewing the code it looks like a pretty easy win to disable the query to check if there is a dimension cached for a particular image which is being called regardless of the THUMBNAIL_CACHE_DIMENSIONS setting. This seems counter intuitive to me so I've added an if statement to check for the setting before running extra queries to find dimensions.