Wikipedia:Purge

From Wikipedia, the free encyclopedia

Shortcut:
WP:PURGE

The purge function is a handy way to clear a page's server cache. This forces the wiki software to rebuild the page completely.

Web Browser Tip: first try refreshing/reloading a page...

Some pages use transclusion to incorporate subpages or templates. If you can't see the transcluded pages properly, purging might help.

Contents

[edit] How to purge

Note: purging may take a few minutes, though it usually happens immediately.

One way is to use the address bar of your browser:

  1. Load the article page normally
  2. At the end of the URL (address) add the text ?action=purge
  3. Go to this address by hitting return or clicking "Go"
  4. The page should be refreshed in a short time

Another way is to use the edit-window URL

  1. Click edit
  2. Go to the address bar in your browser
  3. At the end of the URL (address) there is the text &action=edit replace the "edit" at the end with "purge," so it now reads &action=purge
  4. Go to this address by hitting return or clicking "Go"
  5. The page should be refreshed in a short time

A third way is to use the {{purge}} template which creates a clickable link

  1. Edit the page and add {{purge}} or {{purge|Purge this page's server cache}}
  2. Save the page
  3. Click on the link it creates (named "purge" by default)

This requires making an additional edit to the page.

[edit] How it works

When a change is made to a page, the MediaWiki software saves the change to the main database. The next time a non-logged in user views the page, a copy of that page is made to a "server cache" on a set of secondary servers. Until the page is changed again, all non-logged in users who try to view that page will be shown the copy from the server cache. That way, users who are viewing but not editing do not put a drain on the main database server, and still see the most recent version of the page. (Logged-in users have a choice in their Special:preferences whether to see cached or live versions.)

Normally, when a change is made, the page is marked as "touched" and the software will create a new copy of the page for the server cache. However, when a change is made to a subpage or template, but not to the article page which transcludes it, the article page is not marked as "touched", and a new copy is not generated for the cache. Therefore anyone viewing the article page may see a cached page which includes old versions of the subpage or template.

The purge command forces the server cache to purge the old version of the page. The next time the page is viewed, the page will be rebuilt from scratch, including fresh versions of all subpages and templates, and a new copy will be made for the server cache. Note: that this may take a few minutes.

[edit] For images

Purging an image's description page can be used to force the software to regenerate all the thumbnails for that particular image. If an image thumbnail will not regenerate successfully after the original image has been purged, it is probably because the server has cached an error page with the URL of a thumbnail, but the page is not purged because the actual thumbnail does not exist. The solution is to request the thumbnail with an unusual URL, say by appending ?1 to the end. The thumbnail should then be successfully generated. Finally, do action=purge to delete the cached error. You should only do this if you have tried an ordinary action=purge and it hasn't worked.

[edit] See also

In other languages