https://github.com/visuellverstehen/statamic-advanced-invalidator
A Statamic invalidation class for static caching with advanced capabilities.
https://github.com/visuellverstehen/statamic-advanced-invalidator
Last synced: 2 months ago
JSON representation
A Statamic invalidation class for static caching with advanced capabilities.
- Host: GitHub
- URL: https://github.com/visuellverstehen/statamic-advanced-invalidator
- Owner: visuellverstehen
- License: mit
- Created: 2024-07-02T07:54:43.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-07-04T15:24:32.000Z (10 months ago)
- Last Synced: 2025-01-24T20:46:38.034Z (3 months ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Statamic Advanced Invalidator
A Statamic invalidation class for static caching with advanced capabilities. It allows invalidating named routes, cache keys and [CacheTracker](https://github.com/thoughtco/statamic-cache-tracker) tags when the static cache for content items is cleared.
## How to Install
Simply run the following command from your project root:
``` bash
composer require visuellverstehen/statamic-advanced-invalidator
```## How to Use
In your `static_caching.php` file add AdvancedInvalidator for the `class` key in the `invalidation` section. That allows you to add additional invalidation rules:
```php
use VV\AdvancedInvalidator\AdvancedInvalidator;// …
'invalidation' => [
'class' => AdvancedInvalidator::class,
'rules' => [
'collections' => [
'pages' => [
'urls' => [
// urls to invalidate
],
'named_routes' => [
// route names
// routes will be resolved and merged with urls above
'user.login',
],
'keys' => [
// cache key names
'my-cache-key',
],
'tags' => [
// when using the CacheTracker package you can add
// tags that should be invalidated
'partial:sitemap',
],
],
],
]
]
```## More about us
- [www.visuellverstehen.de](https://visuellverstehen.de)
## License
The MIT license (MIT). Please take a look at the [license file](LICENSE.md) for more information.