Hello,
I wrote a couple of tag extensions that really need to bypass the cache
mechanism, i.e. any page that uses that tag should always be re-created.
I know, this obviously impact performances, but we are talking "small
server" here, not Wikipedia :)
Nevertheless, there must be a way to achieve that, am I wrong ? I mean, it
seems pretty reasonable that an extension might perform SQL queries, or
inspect the current context, return time-dependent values, etc., and
therefore the caching mechanism will just make them useless most of the time.
So far, the only two settings that I know that disable the cache are:
- User preferences: misc settings: Disable page caching
- DefaultSettings.php: $wgCachePages
In my extension callback, I tried the following code:
$wgOut->addMeta("http:Pragma", "no-cache");
$wgOut->addMeta("http:no-cache", NULL);
$wgOut->addMeta("http:EXPIRES", "TUES, 31 DEC 1996 12:00:00
GMT");
which adds the following headers to the page:
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="no-cache" content="" />
<meta http-equiv="EXPIRES" content="TUES, 31 DEC 1996 12:00:00
GMT" />
but without success.
So I assume my extension callback is called *after* the decision is made
that the page should be served from the cache and not re-created ?
Unless I'm wrong, OutputPage::checkLastModified() seems to be the point
where that very decision is made. Is there anyway to influence the outcome
of that function from an extension ? It sure tests for $wgCachePages, and
the user's "no-cache" option, then do some magic on HTTP_IF_MODIFIED_SINCE.
Any clue ?
Thanks
--
Sebastien Barre