jorisnoo / statamic-bunny-purge
Automatically purge Bunny CDN cache when Statamic content changes.
Fund package maintenance!
Joris Noordermeer
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
pkg:composer/jorisnoo/statamic-bunny-purge
Requires
- php: ^8.3
- illuminate/contracts: ^11.0||^12.6
- spatie/laravel-package-tools: ^1.16
- statamic/cms: ^5.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^10.0.0||^9.0.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.35
This package is auto-updated.
Last update: 2026-01-28 16:13:17 UTC
README
Automatically purge Bunny CDN cache when Statamic content changes.
Installation
You can install the package via composer:
composer require jorisnoo/statamic-bunny-purge
You can publish the config file with:
php artisan vendor:publish --tag="statamic-bunny-purge-config"
This is the contents of the published config file:
return [ 'api_key' => env('BUNNY_PURGE_KEY'), 'api_url' => env('BUNNY_PURGE_API_URL', 'https://api.bunny.net/purge'), 'site_url' => env('BUNNY_PURGE_SITE_URL', env('APP_URL')), 'auth_type' => env('BUNNY_PURGE_AUTH_TYPE', 'bunny'), // 'bunny' or 'bearer' ];
Configuration
Add the following environment variables to your .env file:
BUNNY_PURGE_KEY=your-bunny-api-key
Usage
The package works automatically. It listens to Statamic's URL invalidation events and purges the corresponding URLs from your Bunny CDN cache whenever content changes.
Alternative Endpoints
If you're using a custom cache purging endpoint instead of the default Bunny CDN API, you can configure the package to use Bearer token authentication:
BUNNY_PURGE_API_URL=https://your-custom-endpoint.com/purge BUNNY_PURGE_AUTH_TYPE=bearer
This changes the Authorization header from AccessKey: {key} to Bearer {key}.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.