Skip to main content

E-commerce Platforms

E-commerce Platforms

Flash Catalog Images Cache Magento2

To flash the Catalog Images cache, first of all instantiate the Object and Event Manager in your constructor

 

private $objectManager;
private $eventManager;

public function __construct(
    \Magento\Framework\ObjectManagerInterface  $objectManager,
    \Magento\Framework\Event\Manager $eventManager
){
     $this->objectManager = $objectManager;
        $this->eventManager = $eventManager;
 }

After that you can clean the catalog images cache by using this two code lines

Magento2 Refresh Cache for Single Product

Magento’s cache management system saves loaded data, configuration, instructions, images, assets, and more for increased performance loading and rapid access on the storefront. It offers increased stability on your website during heavy user load and greater customer browsing activity. Having a slow-performing website can also negatively impact your conversion

You can use this code to refresh the cache for single product

Magento2 indexes

First of all you need to change the directory to  shell folder under magento root

 

Checking for the status of all indexes

php bin/magento indexer:status


Re-indexing a single index
Each index has its own index key that you can use to reference it when asking Magento to re-index. To get these keys, you can use the following command:

php bin/magento indexer:info

 

Magento1 indexes

First of all you need to change the directory to  shell folder under magento root

{Magento root}/shell

 

Checking for the status of all indexes

php indexer.php --status


Re-indexing a single index
Each index has its own index key that you can use to reference it when asking Magento to re-index. To get these keys, you can use the following command:

php indexer.php --info