Extension:MagicNoCache

Description
This extension creates a new magic word  __NOCACHE__  and disables the cache for any page in which it finds it.

The extension will attempt to disable the caching of the page by calling the disableCache function of the Parser object and also the enableClientCache function of the OutputPage object ($wgOut)

I wrote the extension because I was looking for a way to make sure that specific pages never get cached as they get get updated extremely frequently.

Installation

 * 1) Copy the code below and paste it into a new file called "MagicNoCache.php" in your extensions directory
 * 2) Append the following line to the end of your LocalSettings.php file:

Fix for mediawiki 1.11.0
The addMagicWordId function needs to return true for this extension to work in Mediawiki 1.11.0. Below is the new function that works.

If you are using postgresql you may get an error saying Notice: unserialize [function.unserialize]: Error at offset 1010 of 1522 bytes in /includes/BagOStuff.php on line 392

This can be fixed with the current source of mediawiki and by modifying the function "checkForMagicWord" with...

The fix should work, you may need to disable cache in the LocalSettings temporarily before the modifications to start working.