Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
HypeMC committed Oct 24, 2024
1 parent a126dca commit 794543b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
44 changes: 32 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,47 @@
[![Code Coverage](https://codecov.io/gh/sofascore/purgatory-bundle/graph/badge.svg?token=HWMVLVSTIC)](https://codecov.io/gh/sofascore/purgatory-bundle)
[![License](https://poser.pugx.org/sofascore/purgatory-bundle/license)](https://packagist.org/packages/sofascore/purgatory-bundle)

A Symfony bundle for creating and sending cache purge requests to HTTP cache backends like Varnish.
A Symfony bundle designed to automatically generate and send cache purge requests to HTTP cache backends like Varnish.
It leverages Doctrine events to detect changes in entities and generates URLs that need to be purged based on configured
routes.

## Features

* TODO
- **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 through the PHP attribute, `#[PurgeOn]`, allowing you to directly annotate entity classes
with cache purge rules.
- 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 with Symfony Messenger**: Includes built-in support for **Symfony Messenger** to process
purge requests asynchronously for better scalability and efficiency.

## Requirements

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

## Installation

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

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

1. Create the bundle configuration file under `config/packages/purgatory.yaml`. Here is a reference
configuration file:
> [!NOTE]
> If your project uses [Symfony Flex](https://github.com/symfony/flex), no further steps are required.

1. Create a configuration file under `config/packages/purgatory.yaml`. Here's a reference
configuration:
```yaml
purgatory:
Expand Down Expand Up @@ -86,16 +106,16 @@ A Symfony bundle for creating and sending cache purge requests to HTTP cache bac

## Usage

TODO
For detailed instructions and examples, refer to the [documentation](docs/).

## Versioning

This project adheres to [Semantic Versioning 2.0.0](http://semver.org/).
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 might have.
Use the [issue tracker](https://github.com/sofascore/purgatory-bundle/issues) to report any issues you encounter.

## License

See the [LICENSE](LICENSE) file for license rights and limitations (MIT).
See the [LICENSE](LICENSE) file for details (MIT).
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Getting Started

0 comments on commit 794543b

Please sign in to comment.