Thread:Project:Support desk/purging pages

Hi,

Does it anyone know how to tell mediawiki that a given page has been updated, so that it clears the cache and recomputes the new page from scratch?

I need this for an extension for posting comments (http://commenterra.com). This extension replaces tag with current comments. When a user posts a new comment on a page 'url', the comments need to be updated. If I don't do anything, then the update will not be displayed until someone loads 'url?action=purge' (or updates the wiki text). I tried to do the following: when a new comment is posted, I simulate the http request 'url?action=purge' from the server (in the php function that processes the ajax call) via

$ctx = stream_context_create(array('http' => array('method' => 'POST', 'header' => 'Content-Length: 0'))); @fopen($purge_url, 'rb', false, $ctx);

where $purge_url = 'url?action=purge'. (I use POST method since it doesn't require the confirmation.) Then the page is indeed updated, but only for the user that has posted the comments; for all other users mediawiki will still display the old cached version.

In earlier versions of Mediawiki this method seemed to work; simulating request 'url?action=purge' from the server had exactly the same effect as purging the page manually. But with the latest version (1.23.3 on linux, default installation) this was no longer the case.