What is the use of Magento 2.2.6 product image cache?

The question:

I have some points regarding the Product Image Cache to discuss with you.

  1. I have created a product from the Magento admin panel.
  2. After creating the product, I have uploaded two of the product images (same images but different sizes) to that product.
  3. I have downloaded the images from the storefront of our site and see that both the images have the same size (but originally I have uploaded two different sizes).
  4. When I have investigated this issue, I came to know that the Images in the storefront are coming from the product cache.
  5. Now, my doubt is that how this product image cache has generated?.

Please guide me.

Looking forward to hearing from you.

The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

When you upload image for product with specific image sizes, like 1200×1200 and you use it on thumbnail with the size 60×60 and small image like 200×200 and large image like 600×600. It creates cache images according to your given size.

The benefit of this is, user will not suffer in rendering large size images all over the website, it will show small image or thumbnail image on the web page, and that results with the high performance of the website.

Hope you find your answer.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment