# simplemage/magento2-cachewarmup

> SimpleMage Cache Warmup

`composer require simplemage/magento2-cachewarmup`

Canonical URL: https://packagento.com/simplemage/magento2-cachewarmup

## At a glance

- **Vendor**: simplemage (https://packagento.com/simplemage.md)
- **Latest version**: 1.0.1 — released 2025-03-27
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/simplemage/magento2-cachewarmup and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require simplemage/magento2-cachewarmup:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

SimpleMage Cache Warmup

## README

### Overview

The **SimpleMage CacheWarmup** module is designed to enhance the performance of your Magento store by automating the process of warming up the cache for your website's pages. This module is compatible with both **Magento Full Page Cache** and **Varnish**, ensuring that your store's pages are preloaded into the cache, reducing load times for your visitors.

Using this module you do not need advanced rules or settings in Magento, you can add specific URLs from a file added in the admin panel that are important for your business - the most visited subpages or new products, e.g. 1000-2000 most frequently displayed addresses from Google Analytics or another analytics tool with visit statistics.

It is particularly useful for setups with multiple Varnish servers, as it can handle complex infrastructures seamlessly - without coding.

### Key Features

- **Compatibility**: Works with both Magento Full Page Cache and Varnish.
- **URLs from file**: Supports cache warmup based on a list of URLs imported from a file (e.g., from Google Analytics) - can warmup custom pages from every module provider e.g. blog module or category pages with filters applied.
- **Automated custom file read**: If you want to prepare custom automatic file generation with list of URLs you can create your own script and upload file to static path.
- **Multi-Server Support**: Handles infrastructures with multiple Varnish servers or single Varnish instance.
- **Cronjob Integration**: Automates cache warmup at scheduled intervals via cronjob.
- **SSL Verification**: Includes an option to disable SSL verification for local Varnish testing.

### Limitations

- **Customer group**: In this version the module does not support customer groups - it saves pages in the cache only for not logged in clients
- **Clean cache**: If the server performs a full page cache cleanup, the pages will be saved in the cache only after the cronjob is executed again

### Installation

1. Use composer to install

   ```bash
   composer require simplemage/magento2-cachewarmup
   ```

or download the module files and place them in the `app/code/SimpleMage/CacheWarmup` directory within your Magento installation

2. Run the following commands to enable the module:
   ```bash
   php bin/magento setup:upgrade
   php bin/magento setup:di:compile
   php bin/magento cache:flush
   ```
3. Configure the module via the Magento admin panel under `Stores > Configuration > SimpleMage > Cache Warmup`
 - `General Settings`
   - `Varnish Server IPs` - if you have multiple Varnish servers put here public IPs of this servers, if you have Varnish installed on the same server (or not have Varnish installed) leave it blank
   - `File source` - select data source (default option is `File upload`) - if you want to create custom script to prepare automatically URLs to warmup please select option `Static file path` and save your file in Magento system path `var/import/warmup_urls.txt`
   - `File with URLs to warmup` - upload file with URLs you want to warump - supports simple TXT file with URLs separated by new line - you can find example file in repository [example-file.txt](example-file.txt)
   - `Skip verify host SSL certificate` - use only on localhost for testing purposes
 - `Cronjob Settings`
   - `Enable warmup cronjob` - enable or disable warmup cronjob
   - `Cron schedule` - cron expression configuration
   - `Enable debug mode` - enable debugging of every query for every URL from the file
        
### Troubleshooting

1. Cache not warming up properly

If you notice that certain pages are not being cached, follow these steps:

- Enable Debug Mode: Turn on debug mode in the module settings.
- Check Logs: Review the logs to see the status of the requests made by the module.
  - If the status is not 200, there may be a connection issue between your Magento application server and the Varnish server(s).
  - Ensure that your Magento server can send requests to the public IP address of your Varnish server(s).

2. Local Varnish Testing

If you are testing Varnish locally and encountering issues:
- Problem with SSL verification: Use the option in the module settings to disable SSL verification `Stores > Configuration > SimpleMage > Cache Warmup > General Settings > Skip verify host SSL certificate`. This is useful for local environments where SSL certificates may not be properly configured.

### Support
For any issues or questions regarding the module, please open an issue on our GitHub repository.

## Recent Versions

| Version | Released |
|---|---|
| 1.0.1 | 2025-03-27 |
| 1.0.0 | 2025-03-27 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| guzzlehttp/guzzle | 7.* |
| magento/framework | * |

## Quality

Latest release (1.0.1) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 1 | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Pass | 0 |  |
| PHPMD | Pass | 0 |  |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 3 | valid; 3 advisory notes (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 4 | 1 | – | – |
| 2.4.8 | – | 1 | 1 | – |
| 2.4.9 | – | – | 1 | 1 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["simplemage/magento2-cachewarmup"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

simplemage is a Magento 2 vendor on Packagento. See https://packagento.com/simplemage.md for their full catalogue.

