PHPackages                             thathoff/kirby-clear-cloudflare-cache - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. thathoff/kirby-clear-cloudflare-cache

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

thathoff/kirby-clear-cloudflare-cache
=====================================

Kirby plugin to clear Cloudflare cache URLs

v1.2.0(3y ago)91.2k↓50%1[2 issues](https://github.com/thathoff/kirby-clear-cloudflare-cache/issues)MITPHP

Since Mar 1Pushed 3y agoCompare

[ Source](https://github.com/thathoff/kirby-clear-cloudflare-cache)[ Packagist](https://packagist.org/packages/thathoff/kirby-clear-cloudflare-cache)[ RSS](/packages/thathoff-kirby-clear-cloudflare-cache/feed)WikiDiscussions master Synced 1mo ago

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

Clear Cloudflare Cache Kirby Plugin
===================================

[](#clear-cloudflare-cache-kirby-plugin)

This Kirby plugin can automatically purge Cloudflare cached URLs.

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

[](#installation)

### Download

[](#download)

Download and copy this repository to `/site/plugins/clear-cloudflare-cache`.

### Git submodule

[](#git-submodule)

```
git submodule add https://github.com/thathoff/kirby-clear-cloudflare-cache.git site/plugins/clear-cloudflare-cache

```

### Composer

[](#composer)

```
composer require thathoff/kirby-clear-cloudflare-cache

```

Setup
-----

[](#setup)

At a minimum, you must set the following options in your `config.php` file:

```
'thathoff.clearcloudflarecache.cloudflareZoneID' => 'YOUR_CF_ZONE_ID',
'thathoff.clearcloudflarecache.cloudflareEmail'  => 'YOUR_CF_EMAIL',
'thathoff.clearcloudflarecache.cloudflareAPIKey' => 'YOUR_CF_API_KEY',
```

Options
-------

[](#options)

### `thathoff.clearcloudflarecache.cloudflareZoneID`

[](#thathoffclearcloudflarecachecloudflarezoneid)

This must be set to your Cloudflare Zone ID (available in the Overview dashboard).

### `thathoff.clearcloudflarecache.cloudflareEmail`

[](#thathoffclearcloudflarecachecloudflareemail)

This must be set to the email address of your Cloudflare account.

### `thathoff.clearcloudflarecache.cloudflareAPIKey`

[](#thathoffclearcloudflarecachecloudflareapikey)

This must be set to your Cloudflare API Key (available in the Profile page).

### `thathoff.clearcloudflarecache.dependantUrlsForPage`

[](#thathoffclearcloudflarecachedependanturlsforpage)

This must be a function that returns what URL(s) should be cleared after a page modification.

By default, simply returns the URL of the page itself and potentially the previous URL (in the case of a slug change).

```
function ($hook, $page, $oldPage = null) {
    return $oldPage ? [$page->url(), $oldPage->url()] : $page->url();
}
```

If you know that a change to one page affects other pages, you could include them as well. For example, the following would clear the Cloudflare cache for a modified page siblings (including the affected page) and parent pages.

```
'thathoff.clearcloudflarecache.dependantUrlsForPage'=> function ($hook, $page, $oldPage = null) {
    return $page->parents()->add($page->siblings(true));
},
```

Or, a more elaborate example could include a sitemap and content representations:

```
'thathoff.clearcloudflarecache.dependantUrlsForPage'=> function ($hook, $page, $oldPage = null) {
    $urls = [];
    $urls[] = $page->url();
    $urls[] = $page->url() . '.json';
    if ($oldPage) {
        $urls[] = $oldPage->url();
        $urls[] = $oldPage->url() . '.json';
    }
    $urls[] = page('sitemap')->url();
    $urls[] = page('sitemap')->url() . '.xml';
    return $urls;
},
```

The function may return:

- a single Page object
- a single URL string
- a Pages collection of Page objects
- an array of URL strings and/or Page objects
- null, empty array, or empty Pages collection (this will cause no cache to be cleared)

Duplicate URLs will automatically be filtered out.

All URL strings must be absolute URLs (`https://www.example.com/blog`), not relative (`/blog`);

License
-------

[](#license)

MIT

Credits
-------

[](#credits)

Maintained by [Markus Denhoff](https://github.com/thathoff), originally developed by [Neil Daniels](https://github.com/neildaniels)of [The Streamable](https://thestreamable.com)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 55.6% 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 ~629 days

Total

3

Last Release

1367d ago

### Community

Maintainers

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

---

Top Contributors

[![neildaniels](https://avatars.githubusercontent.com/u/417182?v=4)](https://github.com/neildaniels "neildaniels (5 commits)")[![thathoff](https://avatars.githubusercontent.com/u/797760?v=4)](https://github.com/thathoff "thathoff (4 commits)")

---

Tags

cloudflarekirby3kirby3-plugin

### Embed Badge

![Health badge](/badges/thathoff-kirby-clear-cloudflare-cache/health.svg)

```
[![Health](https://phpackages.com/badges/thathoff-kirby-clear-cloudflare-cache/health.svg)](https://phpackages.com/packages/thathoff-kirby-clear-cloudflare-cache)
```

###  Alternatives

[mzur/kirby-uniform

A versatile Kirby plugin to handle web form actions.

26068.3k13](/packages/mzur-kirby-uniform)[arnoson/kirby-vite

Vite helper for Kirby CMS

9759.2k3](/packages/arnoson-kirby-vite)[thathoff/kirby-git-content

Plugin to track changes to content in a git repository.

15343.7k](/packages/thathoff-kirby-git-content)[sylvainjule/locator

A map &amp; geolocation field, built on top of open-source services / Mapbox

11237.3k1](/packages/sylvainjule-locator)[tobimori/kirby-seo

The default choice for SEO on Kirby: Implement technical SEO &amp; Meta best practices with ease and provide an easy-to-use editor experience

10039.7k1](/packages/tobimori-kirby-seo)[fabianmichael/kirby-meta

Your all-in-one powerhouse for any SEO and metadata needs imaginable.

6910.7k1](/packages/fabianmichael-kirby-meta)

PHPackages © 2026

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