Extension:CloudflarePurge
Appearance
Release status: stable |
|
|---|---|
| Description | Purge the Cloudflare cache of edited and deleted pages |
| Author(s) | Sophivorustalk |
| Latest version | 1.1 |
| MediaWiki | >= 1.39.4 |
| PHP | 7.4+ |
|
|
| Licence | GNU General Public License 3.0 or later |
| Download | |
| Translate the CloudflarePurge extension if it is available at translatewiki.net | |
The CloudflarePurge extension automatically purges the Cloudflare cache of edited and deleted pages.
Installation
[edit]- Download and move the extracted
CloudflarePurgefolder to yourextensions/directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CloudflarePurge
- Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'CloudflarePurge' ); $wgCloudflarePurgeZoneID = ''; $wgCloudflarePurgeToken = '';
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Configuration parameters
[edit]Recommended method (API Token)
[edit]// Cloudflare Zone ID, see your Cloudflare Overview dashboard
$wgCloudflarePurgeZoneID = '';
// Cloudflare API Token with Cache Purge permission
$wgCloudflarePurgeToken = '';
To generate an API Token:
- Go to https://dash.cloudflare.com/profile/api-tokens
- Click "Create Token"
- Click "Get started" near "Create Custom Token"
- Fill the form:
- Token name: Choose any convenient name (e.g., "MediaWiki Purge token")
- Permissions: Zone → Cache Purge → Purge
- Zone Resources: Include → Specific Zone → Select your target zone
- Click "Continue to summary"
- Click "Create token"
- Copy the generated token string and use it as $wgCloudflarePurgeToken
Legacy method (Global API Key)
[edit]// Cloudflare Zone ID, see your Cloudflare Overview dashboard
$wgCloudflarePurgeZoneID = '';
// Email address of your Cloudflare account
$wgCloudflarePurgeAuthEmail = '';
// Cloudflare Global API Key, see https://dash.cloudflare.com/profile/api-tokens
$wgCloudflarePurgeAuthKey = '';
See also
[edit]- Manual:Cloudflare – Documentation on how to set up Cloudflare for MediaWiki
- Extension:Cloudflare – Similar extension that also purges files
- Extension:MultiPurge – Similar extension that can purge both Varnish and Cloudflare
