Despite best efforts, I have images in cache that aren't loading, primarily because they are not present in the cache directory. I have tried clearing the media images cache. Short of deleting all contents of that directory or manually trying to import the images (which I would need to resize to the respective size before importing), I have tried everything to get the images stored in the cache directory. The images were previously loading, but aren't anymore. Does anyone have a solution?

  • Why do you want images in your cache directory? They belong to /media
    – Black
    Sep 19, 2018 at 17:57

2 Answers 2


There are many things that could be causing this issue, Please look into few things:

  1. Make sure the product images exist under /media/catalog/product/ (relative to your document root)
  2. On the Product Information page in your admin backend, under 'Images', make sure the radio buttons have an image selected for 'Base Image', 'Small Image', 'Thumbnail', and that they aren't 'Excluded'.

  3. Make sure the /media directory is in your Apache web server's group (usually 'www-data' or 'httpd'). Magento also needs to be able to write to this directory, so you can run this command to set those permissions:

    sudo chmod -R 775 /path/to/magento/media

  4. In System->Configuration->General->Web, make sure "Base Media URL" is correct under both "Secure" and "Unsecure.

If this answer is useful Please mark it as solution thanks.

  • sudo chmod -R 775 ended up doing the trick. Thanks.
    – Shay Maor
    Sep 20, 2018 at 18:24

Use below commands for Magento 2 :

  1. rm -rf var/* generated/* pub/static/*
  2. php bin/magento setup:static-content:deploy -f
  3. chmod -R 0777 var/* generated/* pub/static/*
  4. php bin/magento cache:flush

For Magento 1 :

  1. media folder permission 777

  2. deleted htaccess file under the media folder

  3. clear the cache and full_page_cache

  4. cache folder is writeable

  5. rebuilt all indexes

Hint : https://stackoverflow.com/questions/20074824/magento-not-rebuilding-product-image-cache

  • For (Magento 1) step 2 did it for me, thank you!!
    – TawabG
    Sep 10, 2019 at 23:43

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.