13 September 2006 ~ 9 Comments

Disabling caching in MediaWiki

After fighting with MediaWiki for a while, I finally figured out how to disable all forms of page caching so that it actually hands over the latest version of a given page when I ask for it.

To disable caching (including memcached) add the following lines to your LocalSettings.php file:

## Disable all forms of MediaWiki caching
$wgMainCacheType = CACHE_NONE;
$wgMessageCacheType = CACHE_NONE;
$wgParserCacheType = CACHE_NONE;
$wgCachePages = false;

You probably already have the $wgMainCacheType line, so just add the other three lines if you need those.

As a side note, you should make these changes in LocalSettings.php rather than in DefaultSettings.php (as some have recommended). DefaultSettings.php should not be edited, and is there just to give you a list of all of the available settings and their default values.

9 Responses to “Disabling caching in MediaWiki”

  1. Marcel 17 January 2007 at 9:26 pm Permalink

    Thanks, this really helped me!

  2. Tobi 12 February 2007 at 3:22 pm Permalink

    Thank You… exactly what i’ve been searching for…. (for a few hours now)…

  3. Steven Larmore 20 February 2007 at 1:11 pm Permalink

    What version of mediawiki?

    ~Steve

  4. John 20 February 2007 at 5:44 pm Permalink

    Steven:

    Do you mean which version was I using when I wrote this post? At the time I think I was using MediaWiki 1.7.1.

    - John

  5. Jay 30 May 2007 at 10:34 am Permalink

    Thanks, this helped me too!

  6. Robert Fleming 31 October 2007 at 3:24 pm Permalink

    See also:

    http://www.mediawiki.org/wiki/Extensions_FAQ#How_do_I_disable_caching_for_pages_using_my_extension.3F

  7. zsh 7 May 2008 at 8:02 am Permalink

    Thanks.

  8. bookkeepr 7 November 2008 at 9:04 am Permalink

    thanks – solved my problem.

  9. rajan srivastava 31 March 2009 at 4:29 am Permalink

    when i add header and footer then cache is not working in mediawiki.
    i want to helh and code to the caching.


Leave a Reply