PHPackages                             sofascore/purgatory-bundle - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. sofascore/purgatory-bundle

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

sofascore/purgatory-bundle
==========================

A Symfony bundle for HTTP cache invalidation with support for various backends like Varnish.

v1.3.2(3w ago)11875.4k↓49.5%3[2 issues](https://github.com/sofascore/purgatory-bundle/issues)[5 PRs](https://github.com/sofascore/purgatory-bundle/pulls)MITPHPPHP &gt;=8.1CI passing

Since Jul 15Pushed 1w ago13 watchersCompare

[ Source](https://github.com/sofascore/purgatory-bundle)[ Packagist](https://packagist.org/packages/sofascore/purgatory-bundle)[ RSS](/packages/sofascore-purgatory-bundle/feed)WikiDiscussions 2.x Synced 2d ago

READMEChangelog (10)Dependencies (48)Versions (26)Used By (0)

SofascorePurgatoryBundle
========================

[](#sofascorepurgatorybundle)

[![Latest Stable Version](https://camo.githubusercontent.com/aee50b0fe2a49e41231db572e8c254aa2cc58128d0d899583611f4d4a151ac62/68747470733a2f2f706f7365722e707567782e6f72672f736f666173636f72652f7075726761746f72792d62756e646c652f762f737461626c65)](https://packagist.org/packages/sofascore/purgatory-bundle)[![Build Status](https://github.com/sofascore/purgatory-bundle/workflows/Tests/badge.svg)](https://github.com/sofascore/purgatory-bundle/actions)[![Code Coverage](https://camo.githubusercontent.com/5d36f83d9cbbd9c2a5ad0d16c67d06a85d8fee15004467c3425da071fea77a28/68747470733a2f2f636f6465636f762e696f2f67682f736f666173636f72652f7075726761746f72792d62756e646c652f67726170682f62616467652e7376673f746f6b656e3d48574d564c5653544943)](https://codecov.io/gh/sofascore/purgatory-bundle)[![License](https://camo.githubusercontent.com/65cb9a2096770536ac8b918f019d8bbb80d31267eb6a98bcb8537b3869c67e99/68747470733a2f2f706f7365722e707567782e6f72672f736f666173636f72652f7075726761746f72792d62756e646c652f6c6963656e7365)](https://packagist.org/packages/sofascore/purgatory-bundle)

Purgatory is a Symfony bundle for HTTP cache invalidation, designed to automatically generate and send cache purge requests to HTTP cache backends like Symfony's HTTP cache or Varnish. It leverages Doctrine events to track changes in entities and generates URLs that need purging based on configured routes.

Features
--------

[](#features)

- **Doctrine Event Integration**: Listens to **Doctrine** lifecycle events (`postUpdate`, `postRemove`, `postPersist`) to automatically detect when entities are modified, created, or deleted.
- **Automatic URL Generation**: Automatically generates purge requests for relevant URLs based on the affected entities and their associated routes.
- **Flexible Configuration**:

    - Primary configuration is done through the `#[PurgeOn]` attribute, allowing you to annotate controller actions with cache purge rules based on entities used in the response.
    - Supports YAML configuration for flexibility depending on your project's requirements.
- **Built-in Purger Support**: Comes with built-in support for **Symfony HTTP Cache** and a basic **Varnish**implementation. For advanced use cases, you can create custom purgers by implementing the `PurgerInterface`.
- **Asynchronous Processing**: Includes built-in support for **Symfony Messenger** to process purge requests asynchronously for better scalability and efficiency.

Requirements
------------

[](#requirements)

- [PHP 8.1](http://php.net/releases/8_1_0.php) or higher
- [Symfony 6.4](https://symfony.com/roadmap/6.4) or [Symfony 7.4](https://symfony.com/roadmap/7.4) or higher

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

[](#installation)

Require the bundle using [Composer](https://getcomposer.org/):

```
composer require sofascore/purgatory-bundle
```

If your project doesn't use [Symfony Flex](https://github.com/symfony/flex), continue with the following steps:

1. Create a configuration file under `config/packages/purgatory.yaml`. Here's a reference configuration:

    ```
    purgatory:

        # List of files or directories where Purgatory will look for additional purge definitions.
        mapping_paths:        []

        # Route names that match the given regular expressions will be ignored.
        route_ignore_patterns: []

            # Examples:
            # - /^_profiler/
            # - /^_wdt/
        doctrine_middleware:
            enabled:              true

            # Explicitly set the priority of Purgatory's Doctrine middleware.
            priority:             null

        # Explicitly set the priorities of Purgatory's Doctrine event listener.
        doctrine_event_listener_priorities:
            preRemove:            null
            postPersist:          null
            postUpdate:           null

            # This event is not registered when the Doctrine middleware is enabled.
            postFlush:            null
        purger:

            # The ID of a service that implements the "Sofascore\PurgatoryBundle\Purger\PurgerInterface" interface
            name:                 null # Example: symfony

            # The hosts from which URLs should be purged
            hosts:                []

            # The service ID of the HTTP client to use, must be an instance of Symfony's HTTP client
            http_client:          null
        messenger:

            # Set the name of the messenger transport to use
            transport:            null

            # Set the name of the messenger bus to use
            bus:                  null

            # Set the number of urls to dispatch per message
            batch_size:           null

        # Enables the data collector and profiler panel if the profiler is enabled.
        profiler_integration: true
    ```
2. Enable the bundle in `config/bundles.php` by adding it to the array:

    ```
    Sofascore\PurgatoryBundle\PurgatoryBundle::class => ['all' => true],
    ```

Usage
-----

[](#usage)

For detailed instructions and examples, refer to the [documentation](https://sofascore.github.io/purgatory-bundle/).

Versioning
----------

[](#versioning)

This project follows [Semantic Versioning 2.0.0](http://semver.org/).

Reporting Issues
----------------

[](#reporting-issues)

Use the [issue tracker](https://github.com/sofascore/purgatory-bundle/issues) to report any issues you encounter.

License
-------

[](#license)

See the [LICENSE](LICENSE) file for details (MIT).

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance97

Actively maintained with recent releases

Popularity45

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 78.2% 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.

###  Release Activity

Cadence

Every ~72 days

Recently: every ~48 days

Total

26

Last Release

7d ago

Major Versions

v0.5.1 → v1.0.0-RC12024-10-22

1.x-dev → 2.x-dev2026-06-26

PHP version history (3 changes)0.0.1PHP &gt;=7.4

v0.4.0PHP &gt;=8.0

v0.5.0PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2445045?v=4)[HypeMC](/maintainers/HypeMC)[@HypeMC](https://github.com/HypeMC)

![](https://www.gravatar.com/avatar/b13bda1393d5f36c8233161616e5bc81299c1a740ebcef315d2ecefdb78d2762?d=identicon)[sofascore](/maintainers/sofascore)

---

Top Contributors

[![HypeMC](https://avatars.githubusercontent.com/u/2445045?v=4)](https://github.com/HypeMC "HypeMC (172 commits)")[![Brajk19](https://avatars.githubusercontent.com/u/80004828?v=4)](https://github.com/Brajk19 "Brajk19 (43 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![mmartinko](https://avatars.githubusercontent.com/u/25147640?v=4)](https://github.com/mmartinko "mmartinko (1 commits)")[![plantas](https://avatars.githubusercontent.com/u/3367132?v=4)](https://github.com/plantas "plantas (1 commits)")[![SombreroMinero](https://avatars.githubusercontent.com/u/96486444?v=4)](https://github.com/SombreroMinero "SombreroMinero (1 commits)")

---

Tags

cachecachinghttphttp-cachehttp-cachinginvalidationphppurgesemversymfonysymfony-bundlevarnishhttpcachecachingvarnishpurgeinvalidationhttp-cachehttp-caching

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sofascore-purgatory-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/sofascore-purgatory-bundle/health.svg)](https://phpackages.com/packages/sofascore-purgatory-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M737](/packages/sylius-sylius)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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