Mediawiki purge cache on ALL files

From Is-beer-a-vegetable.com
Jump to: navigation, search

To clear the cache for all files on a MediaWiki, you need shell access.

Add $wgInvalidateCacheOnLocalSettingsChange = true; and $wgEnableParserCache = true;

to/path-to-wiki/wiki/LocalSettings.php

Using a text edit such as vim, open /path-to-wiki/wiki/LocalSettings.php and save it. This effectively clears the cache timestamp so any file edited prior to LocalSettings.php timestamp are re-fetched and not taken from the cache.

The unix command touch /path-to-wiki/wiki/LocalSettings.php would have the same effect.

MediaWiki Namespaces

A bit of lazy cut and paste to show the purpose of each namespace:


                    '0'  => '(articles)',
                    '1'  => 'Talk:',
                    '2'  => 'User:',
                    '3'  => 'User_talk:',
                    '4'  => 'Project',
                    '5'  => 'Project_talk:',
                    '6'  => 'File:',
                    '7'  => 'File_talk',
                    '8'  => 'MediaWiki:',
                    '9'  => 'MediaWiki_talk:',
                    '10' => 'Template:',
                    '11' => 'Template_talk:',
                    '12' => 'Help:',
                    '13' => 'Help_talk:',
                    '14' => 'Category:',
                    '15' => 'Category_talk:',

MediaWiki - Clear the cache of a single page

To clear the cache on an individual page on a MediaWiki the easy way is to click the view-history link, delete the word history and replace with purge, eg:

from

http://www.is-beer-a-vegetable.com/wiki/index.php?title=Mediawiki_purge_cache_on_ALL_files&action=history

to

http://www.is-beer-a-vegetable.com/wiki/index.php?title=Mediawiki_purge_cache_on_ALL_files&action=purge

Removing Mediawiki cache table to save space

On a busy Wikis, I've had the table 'objectcache' up to 5 gb in size. This caused massive processor load while the tables were being compressed and archived. The table objectcache can be safely deleted without any problems:

Objectcache table is used for a few generic cache operations if not using Memcached. Its content can be deleted and excluded from backups as it will be regenerated when needed. from manual:objectcache table

See also

http://www.mediawiki.org/wiki/Manual:Purge