cancel
Showing results for 
Search instead for 
Did you mean: 

cache:clean CLI command should clear product image cache, too

cache:clean CLI command should clear product image cache, too

I'd like to have a way to clear the product image cache from the CLI. The "cache:clear" command should delete the product image cache, too.

3 Comments
Tom Robertshaw
Moderator

Could you do the same thing by:

 

rm -rf pub/media/catalog/product/cache/
raulspace4
Senior Member

Have you tried using the image resize command to pre-generate all necessary resizes?

 

php bin/magento catalog:image:resize

 

This command gets all the images sizes that have been defined in the theme XML and pregenerates the images in their correct folders.

 

You can also check the command documentation for more information https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/themes/theme-images.html#resize-catalog-i...

matt_ayres
Contributor

I agree.. A CLI for clearing the image cache would be great