Magento 2 Product Image Cache Switch | Emmo

  • Item Number (EMMO): magento-2-product-image-cache-switch
$49.99
plus shipping and handling
$49.99
Emmo
1
1
Add to Wishlist

Magento resizes every product photo into theme sizes and writes them under pub/media/catalog/product/cache. After a cache flush, an import, or a theme change, that folder fills again. This switch is one Admin Yes or No: keep generation on, or skip writing new resized cache files.

One Yes or No under Emmo

Stores → Configuration → Emmo → Product Image Cache. Enable Product Image Cache Generation defaults to Yes, so Magento writes resized files as usual. Set No and the module skips saveFile on the catalog product image.

Learn more ›

New cache files. Not the gallery originals.

Off stops new resized files, so disk stops growing from automatic cache generation. Originals in pub/media/catalog/product stay. Files already in the cache stay. The product gallery in Admin stays.

Learn more ›

Pause one store. Leave the live view on.

The setting has website and store-view scope. Pause generation on staging, and keep it on for the storefront that still needs Magento’s resized files.

Learn more ›

What the switch does

Yes, the default Magento generates and saves resized product images to the catalog image cache. Same as stock Magento.
No New resized files are not written. The module skips saveFile on the catalog product image. Existing cache files are not deleted.
Where it lives Stores → Configuration → Emmo → Product Image Cache. The config path is emmo_product_image_cache/general/enabled. Scope is the store view.

What is left alone

Gallery originals Files in pub/media/catalog/product are not touched.
Cache already on disk Files already under pub/media/catalog/product/cache stay. Off is a write skip, not a flush.
Admin gallery The product gallery in Admin is unchanged. This is not a media cleaner and not a resize CLI.

Turn it Off when

You do not want Magento rewriting cache right now.

  • You flushed image cache and need disk I/O to stay quiet.
  • A catalog import or a theme change would regenerate thousands of sizes.
  • Staging, or a copy of production, should not fill product/cache.
  • A CDN or another resize path already serves the sizes you need.

Keep it On when

The storefront still needs Magento’s resized files.

  • You emptied pub/media/catalog/product/cache and shoppers still hit those URLs.
  • You expected a delete tool. This does not remove files.
  • You need unused originals gone. That is a different module.
  • You have not flushed Magento config cache after saving No.

Off is a write skip, not a flush. Cache files already on disk stay. If the cache folder is empty and generation is Off, resized URLs can 404 until you turn it On again or put the files back.

Five steps. Flip one Yes or No.

  1. 1Enable Emmo_ProductImageCacheSwitch and run setup:upgrade. Unzip the package as app/code/Emmo/ProductImageCacheSwitch.
  2. 2Open Stores → Configuration → Emmo → Product Image Cache.
  3. 3Yes to generate. No to skip new cache writes. Save.
  4. 4Clear Magento configuration cache, and full page cache if you use it, so the store reads the new value.
  5. 5Open a product. With Off, new files should not appear under catalog/product/cache.

No image flush. No unused-file delete. No resize CLI. It only stops or allows Magento writing new product image cache files. Magento Open Source and Adobe Commerce. PHP 8.1–8.5. Stores configuration, store-view scope. Setting: emmo_product_image_cache/general/enabled. Support: [email protected]

More Information

More Information
Follow Meta Tag Index HTML page, follow links

Reviews

Write Your Own Review
Only registered users can write reviews. Please Sign in or create an account