PHPackages                             steadlane/silverstripe-cloudflare - 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. steadlane/silverstripe-cloudflare

ActiveSilverstripe-vendormodule[Caching](/categories/caching)

steadlane/silverstripe-cloudflare
=================================

This module aims to relieve the stress of using Cloudflare caching with any SilverStripe project. Adds extension hooks that clears Cloudflare's cache for a specific page when that page is published or unpublished.

2.0.1(6y ago)243.7k9[5 issues](https://github.com/steadlane/silverstripe-cloudflare/issues)[1 PRs](https://github.com/steadlane/silverstripe-cloudflare/pulls)BSD (3-Clause)PHPPHP ^5.6 || ^7

Since Oct 19Pushed 5y ago2 watchersCompare

[ Source](https://github.com/steadlane/silverstripe-cloudflare)[ Packagist](https://packagist.org/packages/steadlane/silverstripe-cloudflare)[ RSS](/packages/steadlane-silverstripe-cloudflare/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (7)Dependencies (4)Versions (9)Used By (0)

silverstripe-cloudflare
=======================

[](#silverstripe-cloudflare)

[![Build Status](https://camo.githubusercontent.com/b3d600f18f8a40c45101393fb38ae4208a363afbe2b066f14e352a797a598622/68747470733a2f2f7472617669732d63692e6f72672f73746561646c616e652f73696c7665727374726970652d636c6f7564666c6172652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/steadlane/silverstripe-cloudflare) [![Latest Stable Version](https://camo.githubusercontent.com/d2660802f70bff783e8cd19996c74c82cce349f764f3f4113cb583d3b2b39e28/68747470733a2f2f706f7365722e707567782e6f72672f73746561646c616e652f73696c7665727374726970652d636c6f7564666c6172652f762f737461626c65)](https://packagist.org/packages/steadlane/silverstripe-cloudflare) [![Total Downloads](https://camo.githubusercontent.com/59116f6f1c4acaf22b5474fb0296d1a502d1a574f2c8c8a7485bdb3ad3ed46e1/68747470733a2f2f706f7365722e707567782e6f72672f73746561646c616e652f73696c7665727374726970652d636c6f7564666c6172652f646f776e6c6f616473)](https://packagist.org/packages/steadlane/silverstripe-cloudflare) [![License](https://camo.githubusercontent.com/e39d74bdab2e1920a01305573b1b811f58a41c1cf9cfbd938f5b42091ccb121d/68747470733a2f2f706f7365722e707567782e6f72672f73746561646c616e652f73696c7665727374726970652d636c6f7564666c6172652f6c6963656e7365)](https://packagist.org/packages/steadlane/silverstripe-cloudflare) [![Monthly Downloads](https://camo.githubusercontent.com/5de07f61bc21b089c508d5c739b3b2d9dc3a163984414d9b9eb09871d1b572e3/68747470733a2f2f706f7365722e707567782e6f72672f73746561646c616e652f73696c7665727374726970652d636c6f7564666c6172652f642f6d6f6e74686c79)](https://packagist.org/packages/steadlane/silverstripe-cloudflare) [![Code Climate](https://camo.githubusercontent.com/38d9c92511401c2ac87a23c6eb2e0d4e22f8494c65652ade2f8ad190adc31371/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f73746561646c616e652f73696c7665727374726970652d636c6f7564666c6172652f6261646765732f6770612e737667)](https://codeclimate.com/github/steadlane/silverstripe-cloudflare)

Introduction
============

[](#introduction)

The intention of this module is to relieve the double-handling required when updating any of your pages within the CMS of SilverStripe while being behind Cloudflare. When a page is *Published* or *Unpublished* a call will be made to the relevant Cloudflare endpoint to clear the cache of the URL/Page you just published/unpublished.

This allows you to see your changes instantly in the preview window without having to worry about logging into the Cloud Flare dashboard to purge the cache yourself.

Cloudflare allows you to have multiple domains registered under a single account. This module is versatile in the sense that it will automatically detect which Zone ID is to be used alongside the domain that this module is installed on. Therefore beyond the two configuration settings required below there is no additional setup required. You can "plug and play" this module in as many locations as you want which means you don't have to worry about tracking down the relevant Zone ID (you can only get it via the API).

**Remember**: Always keep your API authentication details secure. If you are concerned with your credentials being on someone else's machine; have them set up their own Cloudflare account.

**Note**: The detected Zone ID will always be shown in the SilverStripe Administration panel whilst viewing the "Cloudflare" menu item

Features
--------

[](#features)

- Dynamic Zone ID Detection
- Intelligent Purging
    - If you modify the title or URL of any page: All cache for the zone will be purged.
    - If you modify the contents of any page: Only the cache for that page will be purged.
    - If you modify any page that has a parent, the page you modified and all of it's parents will be purged too.
- Manual Purging
    - The administration area for this module allows you to either purge all css files, all javascript files, all image files or ... everything.

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

[](#installation)

This module only supports installation via composer:

```
composer require steadlane/silverstripe-cloudflare

```

Run `/dev/build` afterwards and `?flush=1` for good measure for SilverStripe to become aware of this module

Configuration
-------------

[](#configuration)

Configuration for this module is minimal, you need only define two constants in `mysite/_config.php`

```
define('CLOUDFLARE_AUTH_EMAIL', 'mycloudflare@example.com.au');
define('CLOUDFLARE_AUTH_KEY', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');

```

Or alternatively, define environment variables in `.env`

```
CLOUDFLARE_AUTH_EMAIL="mycloudflare@example.com.au"
CLOUDFLARE_AUTH_KEY="ABCDEFGHIJKLMNOPQRSTUVWXYZ"

```

Cache Rules
-----------

[](#cache-rules)

It is recommended that you add the below to your Cloudflare Cache Rules as `no-cache`

RuleComments`example.com.au/*stage=Stage*`It is outside the scope of this module to handle cache purging for drafts. Drafts should never need to be cached as they're not usable on the front end`example.com.au/Security/*`Prevents caching of the login page etc`example.com.au/admin/*`Prevents caching of the Administrator Panel`example.com.au/dev/*`Prevents caching of the development tools[![Bypass Cache Example](https://camo.githubusercontent.com/7d94e365a964d18489dee790bfd20d1e6456cb4ba6ea56f1e86417b7fd6e200d/687474703a2f2f692e696d6775722e636f6d2f733337534a58342e706e67)](https://camo.githubusercontent.com/7d94e365a964d18489dee790bfd20d1e6456cb4ba6ea56f1e86417b7fd6e200d/687474703a2f2f692e696d6775722e636f6d2f733337534a58342e706e67)

Contributing
------------

[](#contributing)

If you feel you can improve this module in any way, shape or form please do not hesitate to submit a PR for review.

Troubleshooting and FAQ
-----------------------

[](#troubleshooting-and-faq)

Q. **The SS Cloudflare administrator section is blank!**A. If the Cloudflare administration panel isn't loading correctly, a quick `?flush=1` will resolve this issue.

Q. **The SS Cloudflare footer always says "Zone ID: UNABLE TO DETECT".**A. This module dynamically retrieves your Zone ID by using the domain you have accessed the website with. Ensure this domain is correctly registered under your Cloudflare account. If the issue persists, please open a ticket in our issue tracker and provide as much information you can.

Bugs / Issues
-------------

[](#bugs--issues)

To report a bug or an issue please use our [issue tracker](https://github.com/steadlane/silverstripe-cloudflare/issues).

License
-------

[](#license)

This module is distributed under the [BSD-3 Clause](https://github.com/steadlane/silverstripe-cloudflare/blob/master/LICENSE) license.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

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

Every ~174 days

Recently: every ~253 days

Total

7

Last Release

2442d ago

Major Versions

1.2 → 2.0.x-dev2019-09-02

PHP version history (3 changes)1.0.0PHP &gt;=5.3.3,&lt;7

2.0.x-devPHP &gt;=5.6

2.0.0PHP ^5.6 || ^7

### Community

Maintainers

![](https://www.gravatar.com/avatar/c4e4d3c5202c94d08418997abab91844fd9c3d21b29836c1907499646bfe76f4?d=identicon)[steadlane](/maintainers/steadlane)

![](https://www.gravatar.com/avatar/1a1928aefab455293e2a2ee1d9c392119bfd9a63cb1cc37a70c3ed271196d5e8?d=identicon)[adam-stead](/maintainers/adam-stead)

---

Top Contributors

[![zanderwar](https://avatars.githubusercontent.com/u/13566916?v=4)](https://github.com/zanderwar "zanderwar (77 commits)")[![andrewpike](https://avatars.githubusercontent.com/u/52805661?v=4)](https://github.com/andrewpike "andrewpike (11 commits)")[![robbieaverill](https://avatars.githubusercontent.com/u/5170590?v=4)](https://github.com/robbieaverill "robbieaverill (11 commits)")[![adam-stead](https://avatars.githubusercontent.com/u/589778?v=4)](https://github.com/adam-stead "adam-stead (1 commits)")

---

Tags

cloudflarecloudflare-cachesilverstripesilverstripecachecloudflare

### Embed Badge

![Health badge](/badges/steadlane-silverstripe-cloudflare/health.svg)

```
[![Health](https://phpackages.com/badges/steadlane-silverstripe-cloudflare/health.svg)](https://phpackages.com/packages/steadlane-silverstripe-cloudflare)
```

###  Alternatives

[silverstripe/staticpublishqueue

Static publishing queue to create static versions of pages for enhanced performance and security

45135.4k4](/packages/silverstripe-staticpublishqueue)[yediyuz/laravel-cloudflare-cache

laravel-cloudflare-cache

28239.2k](/packages/yediyuz-laravel-cloudflare-cache)[pstaender/silverstripe-redis-cache

Enables Redis cache for SilverStripe

1199.1k](/packages/pstaender-silverstripe-redis-cache)[silverstripe-terraformers/keys-for-cache

Silverstripe cache key management

1726.6k](/packages/silverstripe-terraformers-keys-for-cache)[tractorcow/silverstripe-dynamiccache

FORK OF Silverstripe module for simple on the fly caching of dynamic content

3916.0k2](/packages/tractorcow-silverstripe-dynamiccache)

PHPackages © 2026

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