Magento Image Cache Storage Requirements

Published: March 5, 2020

Tags:

Recently I’ve been working with a client whose server is running low on disk space. I found that their media/catalog/product folder was 174 GB, 128 GB of which was in media/catalog/product/cache. This seemed like a lot to me, so I did some quick math and realized that the size of their image cache was nearly 3X that of the total size of the source images. This made me curious…what does this ratio look on other Magento installations? I decided to do a little research on this and wanted to share my findings.

The Data

The table below contains my findings:

Site Total media/catalog/product Total media/catalog/product/cache Cache vs Source Percentage
1 23 GB 4.7 GB 25.68%
2 250 GB 113 GB 82.48%
3 7.5 GB 4.9 GB 188.46%
4 2.1 GB 1.5 GB 250.00%
5 174 GB 128 GB 278.26%
6 57 GB 47 GB 470.00%
7 2.2 GB 2.1 GB 2100.00%

Per the table, the median image cache was 2.5X the size of the source images, meaning that the client in question was not unusual at all.

In the course of this research I also came across this git commit. It looks like in Magento 2.4 it will be possible to offload image resizing to a 3rd party such as Fastly.

Max Chadwick Hi, I'm Max!

I'm a software developer who mainly works in PHP, but also dabbles in Ruby and Go. Technical topics that interest me are monitoring, security and performance.

During the day I solve challenging technical problems at Something Digital where I mainly work with the Magento platform. I also blog about tech, work on open source and hunt for bugs.

If you'd like to get in touch with me the best way is on Twitter.