I want to call my observer after the adminhtml_cache_refresh_type event and specifically after full_page

This method does not work, is there a way to do this in observer?

<event name="adminhtml_cache_refresh_type" type="full_page">

2 Answers 2


yes theres a way to do this in observer:

make a file called events.xml in etc folder:

<?xml version="1.0" encoding="UTF-8"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="adminhtml_cache_refresh_type">
        <observer name="RefreshCacheType" instance="Mageplaza\yourmodule\Observer\RefreshCacheType" />

in your observer file RefreshCacheType.php:


namespace Mageplaza\yourmodule\Observer;

use Magento\Framework\App\PageCache\Version;
use Magento\Framework\App\Cache\TypeListInterface;
use Magento\Framework\App\Cache\Frontend\Pool;
protected $cacheTypeList;
protected $cacheFrontendPool;

class RefreshCacheType implements \Magento\Framework\Event\ObserverInterface
    protected $orderFactory;

    public function __construct(
        TypeListInterface $cacheTypeList, 
        Pool $cacheFrontendPool
        $this->cacheTypeList = $cacheTypeList;
        $this->cacheFrontendPool = $cacheFrontendPool;
    public function execute(\Magento\Framework\Event\Observer $observer)
$_types = [
    foreach ($_types as $type) {
    foreach ($this->cacheFrontendPool as $cacheFrontend) {

  • This decision does not mean what I mean.
    – Alice
    Jul 13, 2020 at 11:43
  • you cannot use <event name="adminhtml_cache_refresh_type" type="full_page"> like this especially the type= "full_page", you can make an observer on the adminhtml_cache_refresh_type event and can do what you need in the observer. Jul 13, 2020 at 11:57

The syntax type="full_page" is wrong attribute.You can not use like this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.