PHPackages                             brewdigital/statamic-cloudflare-addon - 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. [Caching](/categories/caching)
4. /
5. brewdigital/statamic-cloudflare-addon

ActiveLibrary[Caching](/categories/caching)

brewdigital/statamic-cloudflare-addon
=====================================

1.0.0(1y ago)00MITPHPPHP ^8.0

Since Feb 4Pushed 1y agoCompare

[ Source](https://github.com/brewdigital/statamic-cloudflare-addon)[ Packagist](https://packagist.org/packages/brewdigital/statamic-cloudflare-addon)[ RSS](/packages/brewdigital-statamic-cloudflare-addon/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Cloudflare Integration for Statamic
===================================

[](#cloudflare-integration-for-statamic)

Cloudflare integration for Statamic with CLI, static caching integration, and control panel integration.

Inspired by [HandmadeWeb/statamic-cloudflare](https://github.com/HandmadeWeb/statamic-cloudflare)

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

[](#requirements)

- Statamic 5.0.0 or higher

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

[](#installation)

You can install the package via composer:

```
composer require brewdigital/statamic-cloudflare-addon
```

#### Copy the package config to your local config with the publish command:

[](#copy-the-package-config-to-your-local-config-with-the-publish-command)

The configuration file will not be published automatically to avoid overwrites. You can publish the configuration file using the following command:

```
php artisan vendor:publish --provider="BrewDigital\StatamicCloudflareAddon\ServiceProvider"
```

The configuration file can be modified from `/cp/utilities/cloudflare/settings`.

Usage
-----

[](#usage)

Update Settings: [![Update Settings](assets/images/settings.png)](assets/images/settings.png)Purge collections per zone: [![Purge Collection Per Zone](assets/images/purge_collection_per_zone.png)](assets/images/purge_collection_per_zone.png)Purge url per zone: [![Purge Url Per Zone](assets/images/purge_url_per_zone.png)](assets/images/purge_url_per_zone.png)Purge options: [![Purge Options](assets/images/purge_options.png)](assets/images/purge_options.png)

### CLI

[](#cli)

You can purge everything via the following command:

```
php artisan cloudflare:cache:purge:everything
```

### Static Caching

[](#static-caching)

If you want to use `statamic-cloudflare` as a static cache strategy, then you will need to manually register the cacher in the register method of your `App\Providers\AppServiceProvider` class:

```
/**
 * Register any application services.
 *
 * @return void
 */
public function register()
{
    \BrewDigital\StatamicCloudflareAddon\Cloudflare::registerCacher();
}
```

Then update your `static_cache` config:

```
'strategies' => [

    'half' => [
        'driver' => 'application',
        'expiry' => null,
    ],

    'full' => [
        'driver' => 'file',
        'path' => public_path('static'),
        'lock_hold_length' => 0,
    ],

    'cloudflare' => [
        'driver' => 'cloudflare',
        'strategy' => 'null',
    ],
],
```

Then update the `static_cache` strategy at the top of the configuration to:

```
'strategy' => 'cloudflare',
```

Currently, the Cloudflare integration is only used for purging. If you would like to use another caching strategy in combination with this caching strategy, then you are free to do that.

This can be done by updating the `strategy` section within the `cloudflare` strategy. Below is an example where we will be caching the application using the [half measure](https://statamic.dev/static-caching#application-driver):

```
'cloudflare' => [
    'driver' => 'cloudflare',
    'strategy' => 'half',
],
```

In theory, you should be able to use any caching strategy here, such as the [full measure](https://statamic.dev/static-caching#file-driver) or any other first or third-party strategies. `statamic-cloudflare` will simply pass requests to the defined strategy and will just hook into the purge actions to also purge the page in Cloudflare.

### Control Panel

[](#control-panel)

#### Events

[](#events)

`statamic-cloudflare` will listen to the `Statamic\Events\EntrySaved`, `Statamic\Events\EntryDeleted`, `Statamic\Events\TermSaved`, and `Statamic\Events\TermDeleted` events and will trigger a purge for the URL. These events will be ignored if you have configured the `static cache` to be a strategy that uses the `cloudflare` driver, as the driver will instead handle the needed purging actions.

#### Utility

[](#utility)

`statamic-cloudflare` will add a utility and a nav item to your Statamic CP.

Route: `/cp/utilities/cloudflare/settings`

This will be available to `Super Users` and the `Cloudflare Manager` and `Manage Brew Cloudflare Settings` are available to be assigned to any role.

You can purge everything quickly by navigating through the purging tabs.

By following these instructions and updating your `composer.json`, you ensure that the Cloudflare addon's configuration file is automatically published after installation or updates.

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

559d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3993?v=4)[Brook Elgie](/maintainers/brew)[@brew](https://github.com/brew)

---

Top Contributors

[![brew-cristian](https://avatars.githubusercontent.com/u/119941211?v=4)](https://github.com/brew-cristian "brew-cristian (1 commits)")

---

Tags

cloudflarestatamicStatamic addonstatamic-pluginstatamic-cache

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/brewdigital-statamic-cloudflare-addon/health.svg)

```
[![Health](https://phpackages.com/badges/brewdigital-statamic-cloudflare-addon/health.svg)](https://phpackages.com/packages/brewdigital-statamic-cloudflare-addon)
```

###  Alternatives

[statamic/statamic

Statamic

832182.1k](/packages/statamic-statamic)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

137236.2k8](/packages/statamic-rad-pack-runway)[statamic/seo-pro

71548.3k](/packages/statamic-seo-pro)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3622.8k](/packages/duncanmcclean-statamic-cargo)[thoughtco/statamic-cache-tracker

1941.0k](/packages/thoughtco-statamic-cache-tracker)[aerni/advanced-seo

Comprehensive SEO addon for Statamic with flexibility in mind

1818.9k](/packages/aerni-advanced-seo)

PHPackages © 2026

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