yireo / autoflushcache
Package info
github.com/yireo/Yireo_AutoFlushCache
Type:magento2-module
pkg:composer/yireo/autoflushcache
Requires
- php: >=8.0
- magento/framework: ^100.1|^101.0|^102.0|^103.0
Requires (Dev)
- composer/composer: *@dev
- phpunit/phpunit: *
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-25 08:46:53 UTC
README
Magento 2 module to automatically flush the cache whenever you save something in the System Configuration.
Do NOT use this in production.
Overview
When saving the System Configuration within Magento 2, the core behaviour is to add a reminder in the backend that you should manually flush the cache. In production, this is a good practice: Instead of flushing the cache with every change, the cache is only flushed when needed. In development, I always keep caching on, and then this becomes annoying. This module automatically flushes the cache for you.
Installation
Install this module within Magento 2 using composer:
composer require yireo/magento2-autoflushcache --dev
bin/magento module:enable Yireo_AutoFlushCache
Technical architecture
This module listens to the event admin_system_config_save, which is
only dispatched after the System Configuration has been saved
successfully. It then refreshes the following cache types:
configblock_htmlfull_page
The cache types are only refreshed when:
- Magento runs in developer mode;
- The current admin user is allowed to refresh cache types (ACL
resource
Magento_Backend::refresh_cache_type).
Other cache entries are left alone: The entire cache storage is not flushed. Every refresh is logged (including the admin username) to the system log.