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

ActiveMediawiki-extension[Utility &amp; Helpers](/categories/utility)

harugon/cloudflare
==================

0.4.0(1mo ago)176[1 issues](https://github.com/harugon/mediawiki-extensions-cloudflare/issues)MITPHPPHP &gt;=8.0CI passing

Since Dec 30Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/harugon/mediawiki-extensions-cloudflare)[ Packagist](https://packagist.org/packages/harugon/cloudflare)[ RSS](/packages/harugon-cloudflare/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (12)Versions (11)Used By (0)

Cloudflare® - MediaWiki
=======================

[](#cloudflare---mediawiki)

[English](./README.en.md)

ページの更新、画像の再アップロード時に Cloudflare のキャッシュをパージします (主に画像のキャッシュを消すことを目的としています)

[MediaWiki で CloudFlare を使う – harugon のブログ](https://blog.r9g.net/archives/121)

導入前に上記のページを読むことをおすすめします。

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

[](#requirements)

- PHP 8.0
- MediaWiki 1.43

Install
-------

[](#install)

[Releases · harugon/mediawiki-extensions-cloudflare](https://github.com/harugon/mediawiki-extensions-cloudflare/releases)

上記の URL より`Cloudflare-{バーション}.tar.gz`のファイルをダウンロードし extensions に展開

LocalSettings.php に Cloudflare の API 情報とともに追記します。

```
wfLoadExtension('Cloudflare');
$wgCloudflareAPIToken = '';
$wgCloudflareZoneID = '';
```

推奨される認証方法は `$wgCloudflareAPIToken` です。[API トークン - Cloudflare](https://dash.cloudflare.com/profile/api-tokens) で "キャッシュのパージ" 権限を持つトークンを作成してください。

非推奨の `$wgCloudflareEmail` と `$wgCloudflareAPIKey` も引き続き使用できますが、将来のリリースで削除されます。

```
// 非推奨:
$wgCloudflareEmail = '';
$wgCloudflareAPIKey = '';
```

Config
------

[](#config)

変数初期値説明$wgCloudflareAPIToken""API Token（ [API トークン - Cloudflare](https://dash.cloudflare.com/profile/api-tokens) で作成したキャッシュパージ権限付きトークン）$wgCloudflareEmail""**非推奨.** レガシー認証用のメールアドレス。代わりに $wgCloudflareAPIToken を使用してください。$wgCloudflareAPIKey""**非推奨.** レガシー認証用のグローバルAPIキー。代わりに $wgCloudflareAPIToken を使用してください。$wgCloudflareZoneID""サイト（URL）固有の ID （サイトごとのダッシュボードで見ることができます）$wgCloudflarePurgePagefalse記事を更新時に purge する$wgCloudflarePurgeFiletrueファイル（画像）を更新時に purge する### 記事ページをキャッシュする

[](#記事ページをキャッシュする)

`$wgCloudflarePurgePage`を有効化する場合 ページルール (Page Rule) に Bypass Cache on Cookie を設定する必要があります。 (BusinessプランとEnterpriseプランのみ有効です。)

この機能は推奨しません。Cloudflare は通常、MediaWiki の記事 HTML を既定ではキャッシュしません。記事ページを Cloudflare でキャッシュするには Cache Rules などで明示的にキャッシュ対象にする必要がありますが、その場合、MediaWiki が管理する CDN purge 経路の外で URL や cache key が増える可能性があります。

MediaWiki では同じ記事が短縮 URL、`index.php?title=...` 形式、モバイル表示、リダイレクト、クエリ文字列付き URL など複数の形式で配信されることがあります。この拡張は、それらの記事 URL を完全に列挙して purge することを保証できません。そのため、Cloudflare 側に古い記事キャッシュが残る可能性があります。

安定性を重視する場合は `$wgCloudflarePurgePage` を無効のままにし、Cloudflare での purge 対象はファイル（画像・サムネイル）に限定する構成を推奨します。記事ページのキャッシュは、MediaWiki の CDN purge 経路と親和性の高い Varnish などで扱うことをおすすめします。

問題
--

[](#問題)

- API Rate limits
- Varnish を挟んでいる場合 ‥（Cloudflare-&gt;Varnish-&gt;origin 先に Cloudflare が消える可能性がある？）

Disclaimer
----------

[](#disclaimer)

Cloudflare, the Cloudflare logo, and Cloudflare Workers are trademarks and/or registered trademarks of Cloudflare, Inc. in the United States and other jurisdictions.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance71

Regular maintenance activity

Popularity9

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.9% 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 ~328 days

Recently: every ~409 days

Total

6

Last Release

50d ago

PHP version history (3 changes)0.1.0PHP &gt;=7.3

0.2.0PHP &gt;=7.4

0.4.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e2b9a8d3b478fb5f5a85265bba4d2d373b1a4d5b7be6daefc6328799c23862b?d=identicon)[harugon](/maintainers/harugon)

---

Top Contributors

[![harugon](https://avatars.githubusercontent.com/u/23746312?v=4)](https://github.com/harugon "harugon (39 commits)")[![hexmode](https://avatars.githubusercontent.com/u/43581?v=4)](https://github.com/hexmode "hexmode (16 commits)")[![lakejason0](https://avatars.githubusercontent.com/u/36039861?v=4)](https://github.com/lakejason0 "lakejason0 (2 commits)")[![NekoCharm01](https://avatars.githubusercontent.com/u/34984380?v=4)](https://github.com/NekoCharm01 "NekoCharm01 (2 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (1 commits)")[![labster](https://avatars.githubusercontent.com/u/108723?v=4)](https://github.com/labster "labster (1 commits)")

---

Tags

cloudflaremediawikimediawiki-extension

### Embed Badge

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

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

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.6k10](/packages/helsingborg-stad-municipio)[mautic/core

Mautic Open Source Distribution

10.3k2.7k9](/packages/mautic-core)[mediawiki/maps

Adds various mapping features to MediaWiki

85155.1k3](/packages/mediawiki-maps)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3407.6k](/packages/starcitizentools-citizen-skin)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

20256.6k4](/packages/civicrm-civicrm-drupal-8)[altis/core

Core module for Altis

19233.0k4](/packages/altis-core)

PHPackages © 2026

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