This is a documentation subpage for 模板:Purge. It may contain usage information, categories and other content that is not part of the original 模板 page. |
This template is used in system messages, and on approximately 390,000 pages, or roughly 8764% of all pages. Changes to it can cause immediate changes to the Wikipedia user interface. To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Please discuss changes on the talk page before implementing them. |
This template uses Lua: |
{{Purge}}
produces a link that will purge the page's cache and rebuild it from the wikitext.
Purpose
For efficiency in service, MediaWiki caches pages. Depending on the exact sequence of actions editors follow, one may view an out-of-date version of a given page. This happens most often on heavily-edited pages and on pages which contain an instance of transclusion.
{{Purge}}
adds to any page a link that, when clicked, not only reloads the page, but clears the server cache, forcing the page to be completely rendered "from scratch". This is not a one-time solution; generally, editing a page is itself sufficient to purge cache. Rather, it is a measure taken in anticipation of the frequent need to purge.
Examples
Code | Yields | Result |
---|---|---|
{{Purge}}
|
Creates a purge link for the page it is used on. | |
{{Purge|<Purge this page's server cache.>}}
|
Creates a purge link for the page it is used on, but with the text "Purge this page's server cache." | |
{{Purge|<page=Main Page>}}
|
Creates a purge link for Main Page. | |
{{Purge|<Purge this page's server cache.>|<page=Main Page>}}
|
Creates a purge link for Main Page, but with the text "Purge this page's server cache." | |
{{Purge|<anchor=TemplateData>}}
|
Creates a purge link for the page it is used on, which points to the "TemplateData" section. |
When you are linking to a section, purging that page will cause you to lose the section link.
TemplateData
TemplateData for Purge
A template that produces a link that will clear the cache and rebuild page from the wikitext
参数 | 描述 | 类型 | 状态 | |
---|---|---|---|---|
Label | 1 | The label of the purge link
| 字符串 | 可选 |
Page | page | The page to purge | 页面名称 | 可选 |
Anchor | anchor | An anchor to jump to after the page is purged | 单行文本 | 可选 |