Last modified: 2008-03-22 11:52:57 UTC
As described in the 1.6 release notes, the OutputPageBeforeHTML hook was designed "to postprocess article HTML on page view (comes after parser cache, if used)." It therefore seemed ideal for the design of extensions that produce rapidly-changing output, since producing it at this late stage would not affect the page cache. However, according to Brion Vibber, this hook is not triggered when loading Squid-cached content ([http://uncyclopedia.org/wiki/Forum:Getting_the_current_user's_username#Alternative], [http://meta.wikimedia.org/wiki/Talk:UserMagic]). Additionally, the hook is not triggered when viewing a page in Preview mode [http://www.undefined.net/w/index.php?title=Test]. These limitations severely hamper the usefulness of this hook in extension writing, and should be removed.
> These limitations severely hamper the usefulness of this hook in extension writing, and should be removed. Please don't. OutputPageBeforeHTML offers one of the only ways an extension developer can inject raw HTML into a page uninhibited by the Parser as of versions 1.6.9, 1.8.3 and 1.9.2.
(In reply to comment #0) > However, according to Brion Vibber, this hook is not triggered > when loading Squid-cached content > ([http://uncyclopedia.org/wiki/Forum:Getting_the_current_user's_username#Alternative], > [http://meta.wikimedia.org/wiki/Talk:UserMagic]). INVALID. Squid is written in C and could not possibly execute PHP hooks. Cache hits won't touch MediaWiki at all. If Squid has a hook architecture, you can use that to write extensions for it, otherwise you have to ask them to add the hooks. We don't control Squid. > Additionally, the hook is not > triggered when viewing a page in Preview mode > [http://www.undefined.net/w/index.php?title=Test]. That's something we can fix (if it's still true). (In reply to comment #1) > > These limitations severely hamper the usefulness of this hook in extension > writing, and should be removed. > > Please don't. OutputPageBeforeHTML offers one of the only ways an extension > developer can inject raw HTML into a page uninhibited by the Parser as of > versions 1.6.9, 1.8.3 and 1.9.2. The suggestion was to apply the hook in more places (i.e., remove restrictions on when the hook is run), not to remove it.
Done in r25341.