Type
magento2-module
magento2-module
MIT
None
None
None
None
None
Displays the cache tags from the current page in the console.
Knowing which cache tags are used on a page allows you to selectively invalidate full page cache for certain tags only. This tool allows you to know which cache tags are used so that you can develop your own cache invalidation functionality. An example of that would be to create a cron job that invalidates the full page cache for the home page only:
class Cron {
protected $_cache;
public function __construct(
\Magento\Framework\Cache\FrontendInterface $cache
) {
$this->_cache = $cache;
}
public function execute() {
$this->_cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, ['cms_page_2']); // default home page tag in 2.1.x
}
}
composer require dakzilla/magento2-cachetags-helper
php bin/magento setup:upgrade
The module only works in developer mode with full page cache disabled. To disable only the full page cache, run this command:
php bin/magento cache:disable full_page
Upon reloading the page, you should see the cache tags appear in your developer console.
This module has been tested with the 2.1 and 2.2 stable branches of Magento 2.
This module is licensed under the MIT License
Copyright 2017 Simon Dakin
Made with ♥ in Montreal