---
title: 'Purge Varnish Cache'
url: 'https://info.srv.kowal.co/docs/magento/modules/purge-varnish-cache'
markdown: 'https://info.srv.kowal.co/docs/magento/modules/purge-varnish-cache.md'
lang: en
date: '2026-11-30'
description: 'See how a Magento cache flush invalidates Varnish entries for each store hostname. Check the local Varnish connection and verify the result in the logs.'
taxonomy:
  category:
    - docs
    - Magento
    - Modules
  tag:
    - cache
    - operations
---

# Purge Varnish Cache

**Composer** `kowal/module-purgevarnishcache` · **Version** 1.0.8

## Product page

[Purge Varnish Cache — kowal.co](https://kowal.co/kowal-purge-varnish-cache)

## 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

```sh
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

```sh
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.

---

## Navigation

- Parent: [Magento 2 Extensions](https://info.srv.kowal.co/docs/magento/modules.md)
- Previous: [Kowal Data Layer](https://info.srv.kowal.co/docs/magento/modules/data-layer.md)
- Next: [Kowal Blog](https://info.srv.kowal.co/docs/magento/modules/blog.md)
