kowal.info

Purge Varnish Cache

Composer kowal/module-purgevarnishcache · Version 1.0.8

Product page

Purge Varnish Cache — kowal.co

Description

When Magento’s cache is flushed from Admin, send a ban to the local Varnish instance for each store hostname.

For whom

For administrators running Magento and the Varnish management interface on the same server.

Features

  • Read hostnames from the configured store base URLs.
  • Issue one ban per distinct hostname.
  • Record the result of each command in Magento logs.

Installation

From the Magento root, with Composer access to the Kowal package, run

composer require kowal/module-purgevarnishcache
bin/magento module:enable Kowal_PurgeVarnishCache
bin/magento setup:upgrade
bin/magento cache:clean

Configuration

  1. Check the base URLs of all store views. The module takes the hostnames from these URLs automatically.
  2. Compare the server setup with the module’s connection settings: the /usr/bin/varnishadm binary, management endpoint 127.0.0.1:6082 and authentication file /etc/varnish/secret.
  3. Confirm with the server administrator that the PHP process serving Magento Admin can invoke the Varnish client with these settings.

Requirements / notes

There is no module-specific configuration form. Version 1.0.8 uses fixed connection parameters. A full flush targets domains across configured stores, so perform the initial check on staging.

FAQ

Does an ordinary CLI cache clean trigger the integration?

The observer listens for adminhtml_cache_flush_all in the Admin area. Use a full cache flush from Admin to trigger the documented workflow.

Verify the installation

bin/magento module:status Kowal_PurgeVarnishCache

On staging, open System → Cache Management and select Flush Cache Storage. Look for the Varnish command result for each expected hostname in the Magento log.