# lizardmedia/module-varnish-warmer

> Varnish Cache Warmer Magento2 module by Lizard Media

`composer require lizardmedia/module-varnish-warmer`

Canonical URL: https://packagento.com/lizardmedia/module-varnish-warmer

## At a glance

- **Vendor**: lizardmedia (https://packagento.com/lizardmedia.md)
- **Latest version**: 2.3.3 — released 2026-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/lizardmedia/module-varnish-warmer 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 lizardmedia/module-varnish-warmer:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Varnish Cache Warmer Magento2 module by Lizard Media

## README

[![Latest Stable Version](https://poser.pugx.org/lizardmedia/module-varnish-warmer/v/stable)](https://packagist.org/packages/lizardmedia/module-varnish-warmer)
[![Total Downloads](https://poser.pugx.org/lizardmedia/module-varnish-warmer/downloads)](https://packagist.org/packages/lizardmedia/module-varnish-warmer)
[![License](https://poser.pugx.org/lizardmedia/module-varnish-warmer/license)](https://packagist.org/packages/lizardmedia/module-varnish-warmer)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/lizardmedia/varnish-warmer-magento2/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/lizardmedia/varnish-warmer-magento2/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/lizardmedia/varnish-warmer-magento2/badges/build.png?b=master)](https://scrutinizer-ci.com/g/lizardmedia/varnish-warmer-magento2/build-status/master)

## Magento2 Varnish Cache Warmer 

Magento2 module for handling Varnish Cache cleaning and regenerating using admin panel
and CLI. It uses multiple process to run the commands to minimize the time required
to run.

### Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

#### Prerequisites

###### For release 1.0
* Magento 2.2
* PHP 7.1

###### For realease 2.0
* Magento 2.3
* PHP 7.1/7.2

###### For realease 2.2
* Magento 2.3
* PHP 7.1/7.2/7.3

###### For realease 2.3
* Magento 2.3/2.4
* PHP 7.1/7.2/7.3/7.4

#### Installing

##### Download the module

###### Using composer (suggested)

Simply run

```
composer require lizardmedia/module-varnish-warmer
```

###### Downloading ZIP

Download a ZIP version of the module and unpack it into your project into
```
app/code/LizardMedia/VarnishWarmer
```
If you use ZIP file you will need to install the dependencies of the module
manually
```
composer require react/http-client:^0.5.9
```

##### Install the module

Run this command
```
bin/magento module:enable LizardMedia_VarnishWarmer
bin/magento setup:upgrade
```

### Usage

##### Admin panel

The commands can be run in backround from admin panel using ``Lizard Media Varnish Warmer``
menu tab.

##### CLI

The commands can be run using Magento built-in CLI:
* ``lm-varnish:cache-purge-homepage`` - purges and regenerates homepage
* ``lm-varnish:cache-purge-general`` - purges and regenerates homepage and categories
* ``lm-varnish:cache-purge-wildcard`` - purges * and regenerates homepage, categories and products
* ``lm-varnish:cache-purge-all`` - purges and regenerates homepage, categories and products
* ``lm-varnish:cache-purge-force`` - purges * without regenerating. Omits lock check
* ``lm-varnish:cache-purge-products`` - purges and regenerates products 
* ``lm-varnish:cache-refresh-url`` - purges and regenerates single URL given as argument

### Command options ##
* store - sets store view ID to get a correct base URL, e.g.
```
php bin/magento lm-varnish:cache-refresh-url "*" --store=1
```

### For developers

The number of process used for purging and regenerating Varnish cache can be customized
in the admin panel. The max number of processes is specified in 
``LizardMedia\VarnishWarmer\Model\Config\GeneralConfigProvider``
If you have a powerful server you can modify those numbers to use more resources.

### Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

### Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/lizardmedia/varnish-warmer-magento2/tags). 

### Authors

* **Maciej Sławik** - *Initial work* - [Lizard Media](https://github.com/maciejslawik)
* **Bartosz Kubicki** - *Fixes & maintenance* - [Lizard Media](https://github.com/bartoszkubicki)

See also the list of [contributors](https://github.com/lizardmedia/varnish-warmer-magento2/contributors) who participated in this project.

### License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Changelog

#### 2.1. ###
* fix for incorrect method for purging process
* adding logging for error request
* minor refactor

#### 2.2 ###
* major refactor
* adding missing return types/types hints
* support for PHP 7.3
* fix for case when urls uses store codes inside after domain

#### 2.2.1 ###
* fix for cache purging headers

#### 2.3 ###
* support for PHP 7.4

#### 2.3.1 ###
* fix for magento installation bug (lack of using proxy in console command class)

## Recent Versions

| Version | Released |
|---|---|
| 2.3.3 | 2026-03-27 |
| 2.3.2 | 2024-02-07 |
| 2.3.1 | 2021-02-05 |
| 2.3 | 2021-01-06 |
| 2.2.1 | 2020-06-16 |
| 2.2.0 | 2020-01-27 |
| 2.1.0 | 2020-01-19 |
| 2.0.2 | 2019-09-01 |
| 2.0.1 | 2019-02-12 |
| 2.0.0 | 2019-02-12 |

Showing 10 of 17 versions. Full release history on https://packagento.com/lizardmedia/module-varnish-warmer.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | >=102.0 |
| magento/module-backend | * |
| magento/module-catalog | * |
| magento/module-config | * |
| magento/module-store | * |
| php | >=7.1.0 |
| react/http-client | ^0.5.9 |

## Quality

Latest release (2.3.3) 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 | not tested | not tested | – | – |
| 2.4.8 | – | not tested | not tested | – |
| 2.4.9 | – | – | not tested | not tested |


### 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 | Fail | 82 | 3 errors, 79 warnings (ruleset: Magento2) — 77 auto-fixable with phpcbf |
| PHPMD | Warning | 2 | 2 rule violations (EmptyCatchBlock:1, ExcessiveClassComplexity:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 6 | valid; 6 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 | Error | Error | – | – |
| 2.4.8 | – | Error | Error | – |
| 2.4.9 | – | – | Error | Error |


### 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=["lizardmedia/module-varnish-warmer"],
  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

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

