Manual:purgeParserCache.php
Appearance
MediaWiki version: | ≥ 1.18 |
MediaWiki file: purgeParserCache.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.43.0 • 1.42.4 • 1.39.11 |
Classes: | PurgeParserCache |
Details
[edit]purgeParserCache.php file is a maintenance script to remove old objects from the parser cache. This script only works when the parser cache is in an SQL database, by setting $wgMainCacheType or $wgParserCacheType to their appropriate values.
Options/Arguments
[edit]Option | Description | Required? |
---|---|---|
--expiredate | Delete objects expiring before this date. The date can be specified in any format supported by the strtotime() function, like, for example, 20241222032759. | Optional |
--age | Delete objects created more than this many seconds ago, assuming $wgParserCacheExpireTime has been consistent. | Optional |
--dry-run | Perform a dry run, to verify age and date calculation. | Optional |
--msleep | Milliseconds to sleep between purge chunks of $wgUpdateRowsPerQuery. | Optional |
--tag | Purge a single server only. This feature is designed for use by large wiki farms where one has to purge multiple servers concurrently in order to keep up with new writes. This requires using the SqlBagOStuff "servers" option in $wgObjectCaches . | Optional |
You must specify either expiredate
or age
.
Usage
[edit]php maintenance/run.php purgeParserCache [ --expiredate| --age | --dry-run| --msleep| --tag ]
Terminal
$ php maintenance/run.php purgeParserCache --age 30 Deleting objects expiring before Tue, 29 Mar 2022 03:02:49 GMT ... 81.9% done (+1 iterations in 0.0s) ... 100.0% done (+2 iterations in 0.0s) Done
In MediaWiki version 1.39.10 and earlier, you must invoke maintenance scripts using
php maintenance/scriptName.php
instead of php maintenance/run.php scriptName
.