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.
January 17th, 2007 at 9:26 pm
Thanks, this really helped me!
February 12th, 2007 at 3:22 pm
Thank You… exactly what i’ve been searching for…. (for a few hours now)…
February 20th, 2007 at 1:11 pm
What version of mediawiki?
~Steve
February 20th, 2007 at 5:44 pm
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
May 30th, 2007 at 10:34 am
Thanks, this helped me too!
October 31st, 2007 at 3:24 pm
See also:
http://www.mediawiki.org/wiki/Extensions_FAQ#How_do_I_disable_caching_for_pages_using_my_extension.3F
May 7th, 2008 at 8:02 am
Thanks.