Magento 2: Clean Cache by Cache Tags Programmatically

This article shows how you can clean cache by cache tags in Magento. use Magento\Framework\App\CacheInterface; class YourClassName { /** * @var CacheInterface */ protected $cache; /** … * @param CacheInterface $cache */ public function __construct( … CacheInterface $cache ) { … $this->cache = $cache; } /** * Clean Cache by Cache Tag * * @param … Read more

Magento 2: Get, Clean and Flush Cache Programmatically

This article shows how you can get the list of all Cache Types in Magento and how you can clean and flush those Cache Types in Magento. Cache Types in Magento Magento has the following cache types: Configuration (config) Commerce collects configuration from all modules, merges it, and saves the merged result to the cache. … Read more