I have the same problem. There should a HTTP header to
invalidate
caches so
that the browser retrieves the page from the server. I guess, we can
look at
the code of recent changes and OutputPage.php to find out what needs
to be
sent. Then it should be OK, I believe, to do $wgOut->whatever() in the
extension code to send it.
Muzo
-----Original Message-----
From: mediawiki-l-bounces(a)Wikimedia.org [mailto:mediawiki-l-
bounces(a)Wikimedia.org] On Behalf Of Jan Steinman
Sent: Thursday, February 17, 2005 11:34 PM
To: MediaWiki announcements and site admin list
Subject: [Mediawiki-l] Caching is making me crazy...
I'm playing with extensions, but am having trouble seeing the results.
How can I mark an article as "dirty" in an extension, so it will
refresh every time?
Here's my extension, using the Unix fortune(6) command, which returns
a
random fortune each time, but when refreshed in a browser, I get the
same one back each time. When I click "edit," I get new results, but
when I refresh my browser, I do not. I even turned debugging on in the
browser and made sure the browser cache was cleared. (It's taking
enough time; it's obviously doing SOMETHING on the server.)
Another odd thing happens: if I use system() or passthru(), the
fortune
DOES refresh, but it prints at the top of the window, rather than
inside the content area. When I tried shell_exec(), it puts the same
old fortune in the content area each time!
extensions/Fortune.php
<?php
$wgExtensionFunctions[] = 'wfFortune';
function wfFortune() {
global $wgParser;
$wgParser->setHook('fortune', 'renderFortune');
}
function renderFortune($input) {
$output = "<p><i>";
$output .= shell_exec('/sw/bin/fortune');
$output .= '</i></p>';
return $output;
}
?>
:::: We in America today are nearer to the final triumph over poverty
than ever before in the history of any land. -- Herbert Hoover, 1928
:::: Jan Steinman <http://www.Bytesmiths.com>
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)Wikimedia.org
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)Wikimedia.org