I'd like to drill on this a little further. First, let me point out that we have disabled the parser cache ($wgEnableParserCache = false;). I'd like to generalize and point out that the Mediawiki's wikitext has multiple codes/tags that can be used to yank external content into the wikitext of an article. My original example was for a site variable. Another good example is a template. I compared the behavior of the two inclusion techniques. When I update a template, all articles that include the template are rendered with the latest page. In contrast, when a system variable changes, the pages are not rendered with the latest content. Is there anyway to get the template's caching behavior with the variables? I really don't want to turn off browser-side caching in it's entirety as I'm sure it will kill performance.
Thanks again, Jeff
-----Original Message----- From: mediawiki-l-bounces@Wikimedia.org [mailto:mediawiki-l-bounces@Wikimedia.org] On Behalf Of Zigger Sent: Sunday, June 12, 2005 12:21 AM To: MediaWiki announcements and site admin list Subject: Re: [Mediawiki-l] Variables in Wikitext & Browser Caching
The "caching problem" is by design, for performance reasons.
With the parser cache on and current, the same value will always be returned, unless "&action=purge" is appended to a query-style URL.
With the parser cache off or expired, as you found, the browser can request a forced refresh e.g. via Ctrl-F5. Alternatively, browser-side caching can be disabled site-wide for all users ($wgCachePages), per logged-in-user (Special:Preferences), or as a user-preference default ($wgDefaultUserOptions['nocache']).
For an example of using an extension to get dynamic content by time-tricking, see http://www.islandseeds.org/wiki/Test:Fortune and http://meta.wikimedia.org/wiki/MediaWiki_FAQ#How_do_I_add_my_own_dynamic_con tent_to_MediaWiki.3F
-- Zigger
On 6/11/05, Wolfe, Jeff wrote:
... The main page of my wiki has the variable {{NUMBEROFARTICLES}} on it. I'm having a problem with multiple client browsers caching this page and not reloading when the variable changes. If I force a reload, the number is rendered correctly. If I change the wikitext, the page is reloaded. Otherwise, I can press F5 all day and not get the latest copy if only the variable has changed. I have verified this with both IE 6.0 and Firefox 1.0.1. I'm running MediaWiki 1.4.1 with a 'recent changes' patch.
Any ideas? Seems like a caching problem with variables. Can I disable caching for this page only? ...
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
On 13/06/05, Wolfe, Jeff Jeff_Wolfe@intuit.com wrote:
My original example was for a site variable. Another good example is a template. I compared the behavior of the two inclusion techniques. When I update a template, all articles that include the template are rendered with the latest page. In contrast, when a system variable changes, the pages are not rendered with the latest content. Is there anyway to get the template's caching behavior with the variables?
Not really, because "global variable changed" is in most cases not a definable event in the same way that "template editted" is; nor, for that matter, is there any record of which pages use a given variable (though this would be relatively easy to implement). Basically, on editting a template triggers the following steps: 1) its parser cache is purged/updated 2) the database is searched for all pages including that template (actually, a schema limitation means that currently all pages *linking to it* are as well) 3) those pages have their parser caches purged
With something like "{{CURRENTDAY}}" it's not obvious what would trigger these steps; a cronjob on the server could, sort of, but only if the database was altered to store what pages used it, etc...
On 6/14/05, Rowan Collins rowan.collins@gmail.com wrote:
On 13/06/05, Wolfe, Jeff Jeff_Wolfe@intuit.com wrote:
My original example was for a site variable. Another good example is a template. I compared the behavior of the two inclusion techniques. When I update a template, all articles that include the template are rendered with the latest page. In contrast, when a system variable changes, the pages are not rendered with the latest content. Is there anyway to get the template's caching behavior with the variables?
Not really, because "global variable changed" is in most cases not a definable event in the same way that "template editted" is; nor, for that matter, is there any record of which pages use a given variable (though this would be relatively easy to implement). Basically, on editting a template triggers the following steps:
- its parser cache is purged/updated
- the database is searched for all pages including that template
(actually, a schema limitation means that currently all pages *linking to it* are as well) 3) those pages have their parser caches purged
With something like "{{CURRENTDAY}}" it's not obvious what would trigger these steps; a cronjob on the server could, sort of, but only if the database was altered to store what pages used it, etc...
Oddly enough, when a page is reparsed (due to caching), category links aren't updated, though by all logic they should. I mean, it's parsing the page. Why shouldn't it update the categorylinks table while it's making a list of categories?
-- Jamie ------------------------------------------------------------------- http://endeavour.zapto.org/astro73/ Thank you to JosephM for inviting me to Gmail! Have lots of invites. Gmail now has 2GB.
Jamie Bliss wrote:
Oddly enough, when a page is reparsed (due to caching), category links aren't updated, though by all logic they should. I mean, it's parsing the page. Why shouldn't it update the categorylinks table while it's making a list of categories?
Links tables are only updated on save, always have been. Logically, the content of a page never changes just because you're displaying it.
Unfortunately, templates and variables screw things up.
-- brion vibber (brion @ pobox.com)
Something doesn't compute here Rowan.
I've got a template {{MPHist}} which is included on my main page to handle "on this day" kind of things.
In turn contains ... {{MPHist/{{CURRENTMONTHNAME}}{{CURRENTDAY}}}}
which selects the proper subpage for the date.
And this seems to work.
So there seem to be cases where system variaables do work as expected. Note that this is even with (or maybe because of?) an extra level of indirection.
On 14/06/05, Rick DeNatale rick.denatale@gmail.com wrote:
Something doesn't compute here Rowan.
{{MPHist/{{CURRENTMONTHNAME}}{{CURRENTDAY}}}} which selects the proper subpage for the date. And this seems to work.
Hmm; my memory was that that explicitly *didn't* work without manual intervention (i.e. trivial/null edits or cache purges), but maybe someone came up with a solution already?
Wikipedia's Talk:Main_Page still has the prominent message "Main Page out of date? Purge the cache (http://en.wikipedia.org/w/wiki.phtml?title=Main_Page&action=purge)..."
On 14/06/05, Rick DeNatale rick.denatale@gmail.com wrote:
Something doesn't compute here Rowan.
{{MPHist/{{CURRENTMONTHNAME}}{{CURRENTDAY}}}} which selects the proper subpage for the date. And this seems to work.
Hmm; my memory was that that explicitly *didn't* work without manual intervention (i.e. trivial/null edits or cache purges), but maybe someone came up with a solution already?
Wikipedia's Talk:Main_Page still has the prominent message "Main Page out of date? Purge the cache (http://en.wikipedia.org/w/wiki.phtml?title=Main_Page&action=purge)..."
mediawiki-l@lists.wikimedia.org