easy-thumbnails icon indicating copy to clipboard operation
easy-thumbnails copied to clipboard

Remove additional queries looking for cached dimensions

Open volksman opened this issue 6 years ago • 0 comments

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.

volksman avatar Jun 18 '18 16:06 volksman