Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Clear the Page Cache in MediaWiki

Did you edit a page, but still see the old version? The page cache may be the reason. This guide shows quick ways to fix it.

CMS and Apps2 min read12 steps

What is a cache?

A cache is a saved copy of something. MediaWiki is the program that runs wikis such as Wikipedia. It saves copies of finished pages, so it does not need to build them again each time. This makes the wiki quick. Sometimes the saved copy is out of date. Then you see old content.

Method 1: Purge the page

To purge means to throw away the saved copy of one page. MediaWiki then builds a fresh one.

  1. Open the page that looks old.
  2. Look at the web address in your browser. It ends in something like /index.php?title=Main_Page or /wiki/Main_Page.
  3. Add ?action=purge to the end. If the address already has a ?, add &action=purge instead.
  4. Press Enter.
  5. If a box appears asking you to confirm, click the Yes or Confirm button.

The page now shows the fresh version.

Method 2: Clear your browser cache

Your own browser also keeps copies. A quick way to ignore them is a hard refresh.

  1. On Windows or Linux, hold Ctrl and press F5.
  2. On a Mac, hold Cmd and Shift and press R.

Method 3: Tell MediaWiki the settings changed

If you changed settings in the LocalSettings.php file, MediaWiki may keep using old page copies. Warning: Back up this file first, because a typo can break the whole wiki.

  1. Open File Manager in your control panel.
  2. Go to your wiki folder and open LocalSettings.php.
  3. Find the line that starts with $wgCacheEpoch. If it is not there, you can add it near the end.
  4. Set it to a number that is bigger than the current one, or to the current time.
  5. Save the file.

This marks all older cached pages as out of date. They are rebuilt when someone visits them.

Tip: If you are not comfortable editing LocalSettings.php, use Method 1 or 2. They are safer.

Still stuck? Open a support ticket with Hostvento.

Quick recap

  • A cache is a saved copy of a page.
  • Add ?action=purge to the page address to refresh one page.
  • Do a hard refresh in your browser.
  • Back up before editing LocalSettings.php.