Auto flush cache for Magento 2 the flush cache is a very special function of Magento 2. The cache is a particular area of your hosting server. It helps to increase the page load speed by storing the web pages through browsers. Also, it reduces resource requirements in the situation of heavy traffic. Every time we edit any information or configuration content after saving we have to clear the cache in admin or run it by command via terminal.
See more information:
- ✅ Automatic Cache Management - No more manual cache clearing after admin changes
- ✅ Intelligent Tag-Based Cache Invalidation - Only clears cache entries related to changed content (NEW)
- ✅ Event-Specific Controls - Enable/disable cache flushing for each event type individually (NEW)
- ✅ Production-Safe Defaults - Optimized configuration that won't impact site performance (NEW)
- ✅ Granular Configuration - Control exactly which cache types to flush
- ✅ Performance Optimized - Removed aggressive cache clearing that caused performance issues (NEW)
| Scenario | Before | After (Tag-Based) |
|---|---|---|
| Single Product Save | Full cache flush | Only product cache tags cleared |
| Bulk Product Import (1000 items) | 1000 full cache flushes | No cache flushing (disabled by default) |
| CMS Page Save | Full cache flush | Only page cache tags cleared |
Before you continue, ensure you meet the following requirements:
- You have installed magento2
Run the following commands in Magento 2 root folder:
composer require magepow/autoflushcache
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
- when install done is an auto flush cache already working.
- You can login as administrator to configure everything without clearing cache.
Navigate to: Stores > Configuration > Magepow > Auto Flush Cache
General Settings:
- Enabled: Master on/off switch for the extension
- Use Intelligent Tag-Based Invalidation: (Recommended) Enable tag-based cache invalidation for better performance
- Cache Types to Flush: Select which cache types to flush (only used when tag-based invalidation is disabled)
Event-Specific Settings (Control which admin actions trigger cache flushing):
- Flush on Configuration Save: ✅ Enabled by default
- Flush on Design Configuration Change: ✅ Enabled by default
- Flush on CMS Page Save: ✅ Enabled by default
- Flush on CMS Block Save: ✅ Enabled by default
- Flush on Product Save: ❌ Disabled by default (can impact performance with bulk operations)
- Flush on Category Save: ❌ Disabled by default (can impact performance with bulk operations)
For best performance on production sites:
✓ Enabled: Yes
✓ Use Intelligent Tag-Based Invalidation: Yes (Recommended)
✓ Flush on Configuration Save: Yes
✓ Flush on Design Change: Yes
✓ Flush on CMS Page Save: Yes
✓ Flush on CMS Block Save: Yes
✗ Flush on Product Save: No (keep disabled to prevent performance issues)
✗ Flush on Category Save: No (keep disabled to prevent performance issues)
If this project help you reduce time to develop, you can give me a cup of coffee :)



