PHPackages                             mbence/varnishpurge - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. mbence/varnishpurge

ActiveSylex-provider[Caching](/categories/caching)

mbence/varnishpurge
===================

Varnish Purge Provider for Silex

04.5kPHP

Since Oct 21Pushed 11y ago2 watchersCompare

[ Source](https://github.com/mbence/varnishpurge)[ Packagist](https://packagist.org/packages/mbence/varnishpurge)[ RSS](/packages/mbence-varnishpurge/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Varnish Purge Provider for Silex
================================

[](#varnish-purge-provider-for-silex)

Easy to use service to purge Varnish keys.

Description
-----------

[](#description)

This provider will create a PURGE request for the predefined Varnish servers, thus invalidating the given url.

Prerequisites
-------------

[](#prerequisites)

This Provider requires Sylex and Varnish-Cache ~v3.0. From the Varnish docs:

```
acl purge {
        "localhost";
        "192.168.55.0"/24;
}

sub vcl_recv {
        # allow PURGE from localhost and 192.168.55...

        if (req.request == "PURGE") {
                if (!client.ip ~ purge) {
                        error 405 "Not allowed.";
                }
                return (lookup);
        }
}

sub vcl_hit {
        if (req.request == "PURGE") {
                purge;
                error 200 "Purged.";
        }
}

sub vcl_miss {
        if (req.request == "PURGE") {
                purge;
                error 200 "Purged.";
        }
}
```

Installation
------------

[](#installation)

### Step 1: Download the bundle using composer

[](#step-1-download-the-bundle-using-composer)

Add the following in your composer.json:

```
{
    "require": {
        "mbence/varnishpurge": "dev-master"
    }
}
```

Then download / update by running the command:

```
$ php composer.phar update mbence/varnishpurge
```

Composer will install the bundle to your project's `vendor/mbence/varnishpurge` directory.

### Step 2: Register the provider

[](#step-2-register-the-provider)

```
$app->register(new MBence\VarnishPurge\VarnishPurgeProvider(), array(
    'varnish.options' => array(
        'servers'   => array('127.0.0.1:8080'),
        'purge'     => 'On'
    ),
));
```

You can turn the purge off with 'purge' =&gt; 'Off'

Usage
-----

[](#usage)

Call the service with a url

```
$app['varnish']->purge('/hello');
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2600280?v=4)[Bence Meszaros](/maintainers/mbence)[@mbence](https://github.com/mbence)

---

Top Contributors

[![mbence](https://avatars.githubusercontent.com/u/2600280?v=4)](https://github.com/mbence "mbence (2 commits)")

### Embed Badge

![Health badge](/badges/mbence-varnishpurge/health.svg)

```
[![Health](https://phpackages.com/badges/mbence-varnishpurge/health.svg)](https://phpackages.com/packages/mbence-varnishpurge)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
