Jump to content

Extension:MultiPurge

From mediawiki.org
MediaWiki extensions manual
MultiPurge
Release status: stable
Implementation Page action , Special page
Description Allows purging of pages for multiple services in a defined order.
Author(s) Octfxtalk
Latest version 2.0.0
MediaWiki >= 1.43.0
PHP >=8.0
Composer octfx/multipurge
  • $wgMultiPurgeServiceOrder
  • $wgMultiPurgeCloudFlareZoneId
  • $wgMultiPurgeStaticPurges
  • $wgMultiPurgeVarnishServers
  • $wgMultiPurgeEnabledServices
  • $wgMultiPurgeCloudFlareApiToken
  • $wgMultiPurgeCloudFlareCacheByDeviceType
  • $wgMultiPurgeRunInQueue
Licence GNU General Public License 2.0 or later
Download

The MultiPurge extension allows the purging of pages and files from multiple caches in a defined order. It was developed to allow the use-case of first purging data from a Varnish cache, and then from Cloudflare.

Installation

[edit]
  • Download and place the file(s) in a directory called MultiPurge in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'MultiPurge' );
    
  • Configure as required.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

[edit]

Usage and configuration information can be found in the README.md file in the extension's repository.

Variable Default Value Type Description
$wgMultiPurgeCloudFlareZoneId null String Zone ID the Wiki Domain is contained in
$wgMultiPurgeCloudFlareApiToken null String API Token found in your dashboard
$wgMultiPurgeVarnishServers null String/Array Array of URLs pointing to your Varnish Servers. Can be IPs
$wgMultiPurgeEnabledServices null Array List of enabled services. Possible values are 'Cloudflare', 'Varnish'
$wgMultiPurgeServiceOrder null Array List of service purge order. Possible values are 'Cloudflare', 'Varnish'. Example: ['Varnish', 'Cloudflare'] purges Varnish, then Cloudflare
$wgMultiPurgeStaticPurges null String/Array Array of URLs that can be purged using the special page. The key is displayed as the selection label. Example:
[
    'Startup script' => 'load.php?lang=en&modules=startup&only=scripts&raw=1&skin=citizen',
    'Site styles' => 'load.php?lang=en&modules=site.styles&only=styles&skin=citizen'
]
$wgMultiPurgeRunInQueue false Boolean Push purge jobs to the job queue instead of running them in sync.
$wgMultiPurgeCloudFlareCacheByDeviceType false Boolean Whether or not Cloudflare's cache by device type is enabled.

Special page

[edit]

MultiPurge adds a special page at Special:PurgeResources which allows purging of ResourceLoader URLs. Any user with the editinterface right can visit the page, enter a page title, then select all ResourceLoader URLs from that page that they want to purge.

See also

[edit]