How to fix page doing 4 extra queries when using easy_thumbnails in combination with Amazon S3?

198 views Asked by At

I'm setting up Amazon S3 to use as my media server for serving image files. I use easy_thumbnails for thumbnailing the images. easy_thumbnails does the cropping before sending them to S3, therefore storing 4 images with each a different size. Without Amazon S3, the page does 2 queries to load the page. With Amazon S3 it uses 6 queries for the same page. The queries show that the original file is queried as well as the cropped file. This shouldn't be necessary I believe. How can I decrease the amount of requests it does using S3?

This image shows the queries with Amazon S3 This image shows the queries with Amazon S3 This image shows the queries normally This image shows the queries without Amazon S3

**edit I noticed easy_thumbnails is not optimized for remote storages according to django packages. So, an alternative for easy_thumbnails that is optimized would help me as well!

1

There are 1 answers

0
Vincent On

It looks like easy_thumbnails requests the same image files everytime the page is loaded (caching that doesn't work for easy_thumbnails maybe). As I read that easy_thumbnails isn't optimized for remote storage I looked for alternatives and tried sorl-thumbnail. This seems to do the job! It doesn't send request each page load and therefore the amount of queries decreased a lot!