API:Purge
From MediaWiki.org
| Language: | English • Deutsch • 日本語 • polski |
|---|
| This page is part of the MediaWiki action API documentation. |
MediaWiki action API
- Introduction and quick start
- FAQ
- Tutorial
- Formats
- Error reporting
- Restricting usage
- Cross-site requests
- Authentication
- Queries
- Searching (by title, content, coordinates...)
- Parsing wikitext and expanding templates
- Purging pages' caches
- Parameter information
- Changing wiki content
- Watchlist feed
- Wikidata
- Extensions
- Using the API in MediaWiki and extensions
- Miscellaneous
- Implementation
- Client code
- Asserting
| MediaWiki version: | 1.14 |
Purging pages' caches[edit]
You can purge the cache of one or more pages using action=purge.
Parameters[edit]
titles/pageids/revids: A list of titles/page IDs/revision IDsforcelinkupdate: If set, updates the link tablesforcerecursivelinkupdate: Like forcelinkupdate, but also do forcelinkupdate on any page that transcludes the current page. This is akin to making an edit to a template. Note that the job queue is used for this operation, so there may be a slight delay when doing this for pages used a large number of times.generator: Use a generator to get the list of pages to purge
Examples[edit]
- Purge file with inconsistent external links table on commons: https://commons.wikimedia.org/w/api.php?action=purge&titles=File:Masopust_držíme_18.jpg&forcelinkupdate
- Purging the cache of Main Page, Nonexistent and Talk:
| Result |
|---|
<?xml version="1.0" encoding="utf-8"?>
<api>
<purge>
<page ns="0" title="Main Page" purged="" />
<page ns="0" title="Nonexistent" missing="" />
<page title="Talk:" invalid="" />
</purge>
</api>
|
Possible errors[edit]
| Code | Info |
|---|---|
| cantpurge | Only users with the 'purge' right can purge pages via the API |

