The question is simple:

Should I add bin/magento catalog:images:resize to our Continuous Integration script, running it on every deployment? Or is it's intent solely to run incidentally (since resized and cached images are also generated upon saving a product)?

Also: does it re-generate all images every time you run it? Or does it detect images that are already resized / cached properly and skips those?

1 Answer 1


Only incidentally.

Generally, product images are cached while saving the product. However, the magento catalog:images:resize command enables you to resize all images for display on your storefront. Situations where this could be necessary might be:

  • After you import products, which might have images of various sizes
  • If images were resized or deleted manually from cache

Each image assigned to a product must be resized in accordance with image metadata defined in a module’s view.xml configuration file. After resizing an image, its resized copy is stored in the cache (/pub/media/catalog/product/cache directory). Magento serves storefront images from cache.

Source: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-images.html#resize-catalog-images

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.