Download the PHP package mage2kishan/module-cachemanager without Composer

On this page you can find all versions of the php package mage2kishan/module-cachemanager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package module-cachemanager

Magento 2 Cache Manager

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

Features

Compatibility

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.

Requirements

Installation

setup: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:

After installation the module is switched off ("Enable Cache Manager" defaults to No), so nothing changes until it is enabled in the configuration.

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/.

General Settings

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.

Cache Warmup

Shown only when "Enable Cache Manager" is Yes; "Warmup Schedule (Cron)", "Pages to Warm Up", "Concurrent Requests" and "Log Redirect Responses As" 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. The value is validated on save: it must have five fields (minute 0-59, hour 0-23, day of month 1-31, month 1-12 or jan-dec, day of week 0-6 or sun-sat) using *, numbers, ranges, lists and /step; anything else is rejected with an error. 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. Whole number from 1 to 50; stored values above 50 are capped at 50. Path: panth_cachemanager/warmup/concurrent_requests.
Log Redirect Responses As Success Status recorded for a URL that answers with a 3xx redirect: "Success", "Skipped" or "Failed". Redirects are never followed. Path: panth_cachemanager/warmup/redirect_status.
Warmup Log Retention (days) 30 Log rows older than this many days are deleted at the start of each warmup run (cron or console). 0 keeps all rows. Default scope only. Path: panth_cachemanager/warmup/log_retention_days.

Cache Invalidation

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.

Admin menu

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.

Usage

Smart invalidation

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.

Scheduled warmup

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 at default scope. Otherwise it deletes log rows older than "Warmup Log Retention (days)" and then, for every active store view where both settings are also Yes at store view scope:

  1. Builds the URL list from that store view's selected page types, using the store view's own base URL: 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 except no-route (<base_url>/<identifier>). The suffixes come from catalog/seo/category_url_suffix and catalog/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.
  2. Splits the list into batches of that store view's "Concurrent Requests" URLs and requests each batch with curl_multi. Each request is limited to http and https, does not follow redirects, verifies the SSL certificate, uses a 10 second connect timeout and a 30 second total timeout, and sends the user agent PanthCacheManager/1.0 (Warmup).
  3. Records every request in panth_cache_warmup_log with the real HTTP status and a result: failed when the transfer itself failed (the per-handle result from curl_multi_info_read(), for example a refused connection, a timeout or a certificate error, recorded with HTTP status 0) or the status is 400 or higher; the "Log Redirect Responses As" value for 3xx; otherwise success.

Product URLs are built from url_key and do not include category paths. Any exception during the run is logged as CacheManager Cron Error.

Console command

Runs 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, SKIP or FAIL, HTTP status, response time, URL and the transfer error if any) as results arrive, followed by a summary line with success and failure counts (and the skipped count when there is one), 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 no request failed and 1 when at least one failed; skipped requests do not count as failures. If no URLs were collected the command prints a notice and exits with 0.

Warmup Log grid

"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 Page, Category Page, Product Page or CMS Page) and has a select filter. Status is shown as a coloured label (Success green, Failed red, Skipped and Pending yellow) and has a select filter. HTTP Status shows "No response" when the request got no HTTP answer (for example DNS, connection or SSL errors). Rows older than "Warmup Log Retention (days)" are deleted at the start of each warmup run.

Developer Notes

Uninstallation

The 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.

Support

Documentation

USER_GUIDE.md covers installation, each configuration group (General Settings, Cache Warmup, Cache Invalidation), the Warmup Log grid, a troubleshooting table and support contacts.

License

Commercial software license. See LICENSE.txt in this repository.

Changelog

See CHANGELOG.md.

Links


All versions of module-cachemanager with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
magento/framework Version ^103.0 || ^104.0
magento/module-store Version ^101.0 || ^102.0
magento/module-catalog Version ^104.0 || ^105.0
magento/module-cms Version ^104.0 || ^105.0
mage2kishan/module-core Version ^1.0
ext-curl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mage2kishan/module-cachemanager contains the following files

Loading the files please wait ...