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

0.1.1 2026-01-28 10:02 UTC

This package is auto-updated.

Last update: 2026-01-28 16:13:17 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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.