Panth Cache Manager adds two things to a Magento 2 store: an observer that cleans the cache tags of a product, category, CMS page or CMS block when it is saved, and a cache warmup that requests the store's home, category, product and CMS page URLs over HTTP so that the full page cache is populated before real visitors arrive. Warmup runs from a Magento cron job on a configurable schedule (every six hours by default) or on demand from a console command, and every request is recorded in a database table that is shown as a grid in the admin.
The module works at the cache and HTTP layer and ships no frontend templates or web assets, so it does not depend on the theme in use. It is intended for store administrators who want scheduled warmup with a request log, and for developers who want to run warmup from the command line.
Product page: Magento 2 Cache Manager
- Cleans the cache tags of the saved product, category, CMS page or CMS block when that entity is saved, with separate on/off switches for products, categories and CMS content.
- Cron job
panth_cachemanager_warmupthat requests the selected page types on the configured schedule usingcurl_multi, with a configurable number of parallel requests (default 5). - Page types available for warmup: "Home Page", "Category Pages", "Product Pages" and "CMS Pages".
- Console command
panth:cachemanager:warmupthat runs the same warmup synchronously and prints per-URL results and a summary. - Database table
panth_cache_warmup_logthat stores URL, page type, HTTP status, result, response time and timestamp for every warmup request. - Admin grid "Warmup Log" under "Panth Extensions" with filters, sorting, column controls and bookmarks.
- All settings except "Warmup Schedule (Cron)" can be set at default, website and store view scope; the schedule is set at default scope only.
- Unit tests for the helper, cron and observer classes under
Test/Unit.
| Platform | Versions |
|---|---|
| Magento Open Source | 2.4.4 to 2.4.8 |
| Adobe Commerce | 2.4.4 to 2.4.8 |
| PHP | 8.1 or later (php: >=8.1 in composer.json) |
Composer constraints on Magento packages: magento/framework ^103.0 or ^104.0, magento/module-store ^101.0 or ^102.0, magento/module-catalog ^104.0 or ^105.0, magento/module-cms ^104.0 or ^105.0.
- Magento Open Source or Adobe Commerce 2.4.4 to 2.4.8.
- PHP 8.1 or later with the curl extension (
ext-curlis a Composer requirement; warmup uses thecurl_multifunctions). mage2kishan/module-core^1.0 (modulePanth_Core). The configuration helper extendsPanth\Core\Helper\AbstractConfig, and the admin menu, ACL and configuration tab hang off the "Panth Extensions" entries thatPanth_Coreprovides. Composer installs it automatically.- The module sequence also declares
Magento_BackendandMagento_PageCache. - Magento cron must be running for scheduled warmup. Warmup requests are plain HTTP GET requests to the store's base URL, so the store must be reachable from the server that runs cron. The module does not talk to Varnish or Redis directly.
composer require mage2kishan/module-cachemanager
bin/magento module:enable Panth_Core Panth_CacheManager
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flushsetup:di:compile is only needed in production mode. The module ships no files under view/*/web, so setup:static-content:deploy is not required for it.
Check that the module is enabled:
bin/magento module:status Panth_CacheManagerAfter installation the module is switched off ("Enable Cache Manager" defaults to No), so nothing changes until it is enabled in the configuration.
Go to Stores > Configuration > Panth Extensions > Cache Manager. Every field except "Warmup Schedule (Cron)" can be set at default, website and store view scope. All config paths start with panth_cachemanager/.
| Setting | Default | What it does |
|---|---|---|
| Enable Cache Manager | No | Master switch. When set to No, the save observer does nothing and the warmup cron job does nothing. Path: panth_cachemanager/general/enabled. |
Shown only when "Enable Cache Manager" is Yes.
| Setting | Default | What it does |
|---|---|---|
| Cache TTL (seconds) | 86400 | Stored at panth_cachemanager/full_page/ttl and exposed through Helper\Data::getCacheTtl(). No code in this module applies the value to the page cache, so changing it has no effect on its own. |
Shown only when "Enable Cache Manager" is Yes; the last three fields are shown only when "Enable Cache Warmup" is Yes.
| Setting | Default | What it does |
|---|---|---|
| Enable Cache Warmup | No | Allows the cron job and the console command to run. Path: panth_cachemanager/warmup/enabled. |
| Warmup Schedule (Cron) | 0 */6 * * * |
Cron expression for the panth_cachemanager_warmup job, read through the config_path of the job in etc/crontab.xml. Default scope only. If it is empty, 0 */6 * * * is used. Path: panth_cachemanager/warmup/warmup_schedule. |
| Pages to Warm Up | Home Page, Category Pages, Product Pages, CMS Pages | Multiselect of page types to request. Path: panth_cachemanager/warmup/warmup_pages, stored as home,catalog_category,catalog_product,cms. |
| Concurrent Requests | 5 | Number of URLs requested in parallel per batch. Must be greater than zero. Path: panth_cachemanager/warmup/concurrent_requests. |
Shown only when "Enable Cache Manager" is Yes; the three per-entity fields are shown only when "Enable Smart Invalidation" is Yes.
| Setting | Default | What it does |
|---|---|---|
| Enable Smart Invalidation | Yes | Enables the save observer. Path: panth_cachemanager/invalidation/smart_invalidation. |
| Invalidate on Product Save | Yes | On catalog_product_save_after, cleans the cache tags of the saved product. Path: panth_cachemanager/invalidation/invalidate_on_product_save. |
| Invalidate on Category Save | Yes | On catalog_category_save_after, cleans the cache tags of the saved category. Path: panth_cachemanager/invalidation/invalidate_on_category_save. |
| Invalidate on CMS Save | Yes | On cms_page_save_after and cms_block_save_after, cleans the cache tags of the saved page or block. Path: panth_cachemanager/invalidation/invalidate_on_cms_save. |
The admin sidebar gets a "Cache Manager" entry under "Panth Extensions" with two items: "Warmup Log", which opens the request log grid, and "Configuration", which opens the configuration section above. Both require the ACL resource Panth_CacheManager::config.
When the module and "Enable Smart Invalidation" are both on, saving a product, category, CMS page or CMS block runs Observer\CacheInvalidate. The observer checks the per-entity switch and then calls Magento\Framework\App\CacheInterface::clean() with the tags returned by the saved entity's getIdentities() (for example cat_p_42 for product 42), so only entries belonging to that entity are removed. If the event carries no entity or the entity returns no identities, it falls back to the tag for the entity type (catalog_product, catalog_category, cms_page or cms_block). Each invalidation is written to the Magento log at info level with the event name and tags. Errors are logged at error level and do not interrupt the save.
Cron job panth_cachemanager_warmup (cron group default, schedule from "Warmup Schedule (Cron)", default 0 */6 * * *) runs Cron\WarmupCache::execute(). It returns immediately unless both "Enable Cache Manager" and "Enable Cache Warmup" are Yes. Otherwise it:
- Builds the URL list from the selected page types, using the base URL of the store that cron runs under: the home page (
/), active categories with level greater than 1 (<base_url>/<url_path><category_url_suffix>), enabled products in that store's website with visibility "Catalog" or "Catalog, Search" (<base_url>/<url_key><product_url_suffix>), and active CMS pages of that store exceptno-route(<base_url>/<identifier>). The suffixes come fromcatalog/seo/category_url_suffixandcatalog/seo/product_url_suffix. Duplicate URLs are removed, and only http or https URLs on the host and port of the store base URL are requested. - Splits the list into batches of "Concurrent Requests" URLs and requests each batch with
curl_multi. Each request is limited to http and https, does not follow redirects (a 3xx response is recorded assuccess), verifies the SSL certificate, uses a 10 second connect timeout and a 30 second total timeout, and sends the user agentPanthCacheManager/1.0 (Warmup). - Records every request in
panth_cache_warmup_logwith statussuccess(no curl error and HTTP status below 400) orfailed.
Product URLs are built from url_key and do not include category paths. Any exception during the run is logged as CacheManager Cron Error.
bin/magento panth:cachemanager:warmup
bin/magento panth:cachemanager:warmup --quiet-rowsRuns the same warmup synchronously and writes to the log table. If "Enable Cache Manager" or "Enable Cache Warmup" is No, the command prints a notice and exits with 0 without requesting anything. Without options it prints one line per URL (OK or FAIL, HTTP status, response time, URL) as results arrive, followed by a summary line with success and failure counts, average response time and total wall time. With --quiet-rows the per-URL lines are not printed and only the summary line is shown. The exit code is 0 when every request succeeded and 1 when at least one failed. If no URLs were collected the command prints a notice and exits with 0.
"Panth Extensions" > "Cache Manager" > "Warmup Log" (admin route panth_cachemanager/warmup/index, page title "Cache Warmup Log") lists every warmup request with the columns ID, URL, Page Type, HTTP Status, Status, Response Time (ms) and Warmed At. All columns can be filtered and sorted. Page Type is the page type the URL was collected for: home, category, product or cms. Nothing prunes this table; it grows with every warmup run.
- Module name:
Panth_CacheManager. Composer package:mage2kishan/module-cachemanager. PHP namespace:Panth\CacheManager. Helper\Data(extendsPanth\Core\Helper\AbstractConfig):isEnabled(),getCacheTtl(),isWarmupEnabled(),getWarmupPages(),getWarmupSchedule(),getConcurrentRequests(),isSmartInvalidationEnabled(),shouldInvalidateOnProductSave(),shouldInvalidateOnCategorySave(),shouldInvalidateOnCmsSave(),getProductUrlSuffix(),getCategoryUrlSuffix(). All accept an optional store ID.Cron\WarmupCache:execute()for cron andrunWarmup(?callable $onResult = null): array, which returns one row per URL (url,page_type,status,http_code,response_time_ms,error) and calls the optional callback with each row as it completes. This is the entry point for running warmup from custom code.Console\Command\WarmupCommand: registered inetc/di.xmlonMagento\Framework\Console\CommandListaspanth_cachemanager_warmup.Observer\CacheInvalidate: registered inetc/events.xmlforcatalog_product_save_after,catalog_category_save_after,cms_page_save_afterandcms_block_save_after.Controller\Adminhtml\Warmup\Index: admin controller for the grid (ADMIN_RESOURCE = Panth_CacheManager::config); layoutpanth_cachemanager_warmup_index.xml; UI componentpanth_cachemanager_warmup_listingbacked byModel\ResourceModel\WarmupLog\Grid\Collection(data sourcepanth_cachemanager_warmup_listing_data_source).Model\WarmupLog,Model\ResourceModel\WarmupLogandModel\ResourceModel\WarmupLog\Collection: entity, resource model and collection for the log table.Model\Config\Source\WarmupPages: option source with the valueshome,catalog_category,catalog_product,cms.Model\Config\Backend\Enabled: backend model for the master switch (currently only calls the parentbeforeSave()).- ACL resources:
Panth_CacheManager::cachemanager("Cache Manager") andPanth_CacheManager::config("Configuration"), both underPanth_Core::panth_extensions. - Admin route:
panth_cachemanager(front namepanth_cachemanager). There are no frontend routes, plugins, preferences, web API endpoints or frontend view files. - Database table
panth_cache_warmup_log(frometc/db_schema.xml):log_id(primary key),url,page_type,http_status,status(defaultpending),response_time(decimal, milliseconds),warmed_at(timestamp, default current time). Indexes onstatusandwarmed_at.
bin/magento module:disable Panth_CacheManager
composer remove mage2kishan/module-cachemanager
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flushThe table panth_cache_warmup_log and the configuration values stored under panth_cachemanager/ in core_config_data remain in the database after these commands; drop or delete them manually if they are no longer wanted.
- Product page: Magento 2 Cache Manager
- Contact form: kishansavaliya.com/contact
- Email: kishansavaliyakb@gmail.com
- Bug reports: GitHub issues
USER_GUIDE.md covers installation, each configuration group (General Settings, Full Page Cache, Cache Warmup, Cache Invalidation), the Warmup Log grid, a troubleshooting table and support contacts.
Commercial software license. See LICENSE.txt in this repository.
See CHANGELOG.md.
- Website: kishansavaliya.com
- All extensions: Magento extensions catalogue
- GitHub: mage2sk/module-cachemanager
- Packagist: mage2kishan/module-cachemanager