I have created a template for a standard report that I want in my wiki. In the template I am putting a unique ID. I am generating the unique ID using an extension with the php time function. To test, I put the XML tags on page so I could see the results. The extension does not get called because the browser has cached it locally. The content is no longer dynamic. Is there anything I can do on the server side to cause the browser to not use its cached version? The extension looks like a nice feature accept it can't deliver dynamic content.
Thanks
Mike
Mike wrote:
I have created a template for a standard report that I want in my wiki. In the template I am putting a unique ID. I am generating the unique ID using an extension with the php time function. To test, I put the XML tags on page so I could see the results. The extension does not get called because the browser has cached it locally. The content is no longer dynamic. Is there anything I can do on the server side to cause the browser to not use its cached version? The extension looks like a nice feature accept it can't deliver dynamic content.
MediaWiki is designed for dynamic editing of static content.
You will have to fight the wiki a lot trying to put dynamic content inside a wiki page. Please see the mailing list archives for past discussions.
http://mail.wikipedia.org/pipermail/mediawiki-l/ (you can search the archives via google by putting site:mail.wikipedia.org in the search term)
-- brion vibber (brion @ pobox.com)
On 13 Mar 2005, at 03:27, Mike wrote:
The extension does not get called because the browser has cached it locally. The content is no longer dynamic. Is there anything I can do on the server side to cause the browser to not use its cached version? The extension looks like a nice feature accept it can't deliver dynamic content.
Ah, you must be new here!
There are a number of us who are lobbying heavily for some sort of cache control mechanism. See the recent archives.
To paraphrase Brion (correct me if I'm wrong), there are several caches operating at different levels, and there is no simple way to provide dynamic content in an editable page.
The solutions I've seen proposed is 1) make your dynamic content a Special page, or 2) have pages conditionally set a "no cache flag" when saved, then add spaghetti code throughout the known universe to do different things based on this bit.
:::: The light at the end of the tunnel is a man with a flashlight yelling, "Go back! Go back!" -- Sol Stein :::: Jan Steinman http://www.Bytesmiths.com/Van
At 3/13/2005 11:53 AM, Jan Steinman wrote:
On 13 Mar 2005, at 03:27, Mike wrote:
The extension does not get called because the browser has cached it locally. The content is no longer dynamic. Is there anything I can do on the server side to cause the browser to not use its cached version? The extension looks like a nice feature accept it can't deliver dynamic content.
The solutions I've seen proposed is 1) make your dynamic content a Special page, or 2) have pages conditionally set a "no cache flag" when saved, then add spaghetti code throughout the known universe to do different things based on this bit.
Or use the following piece of code/hack in your extension, it works just fine for me to adress this "problem" (yes, it is a problem). Again, a hack, but does the trick until a clean solution is found.
$ts = mktime(); $now = gmdate("YmdHis", $ts + 120); $ns = $wgTitle->getNamespace(); $ti = wfStrencode($wgTitle->getDBkey()); $sql = "UPDATE cur SET cur_touched='$now' WHERE cur_namespace=$ns AND cur_title='$ti'"; wfQuery($sql, DB_WRITE, "kwBreadCrumbsNoCache");
-- Sebastien Barre
Thanks, Sebastien! After puzzling through a few necessary changes and stuff, I got Sebastien's cache-disable-hack working.
Full code for my "fortune" extension, including an explanation of the cache-disable-hack, is at "http://www.IslandSeeds.org/wiki/Test:Fortune".
I'm going to move it into a function, so it can more easily be used.
On 13 Mar 2005, at 09:43, Sebastien BARRE wrote:
At 3/13/2005 11:53 AM, Jan Steinman wrote:
On 13 Mar 2005, at 03:27, Mike wrote:
The extension does not get called because the browser has cached it locally. The content is no longer dynamic. Is there anything I can do on the server side to cause the browser to not use its cached version? The extension looks like a nice feature accept it can't deliver dynamic content.
The solutions I've seen proposed is 1) make your dynamic content a Special page, or 2) have pages conditionally set a "no cache flag" when saved, then add spaghetti code throughout the known universe to do different things based on this bit.
Or use the following piece of code/hack in your extension, it works just fine for me to adress this "problem" (yes, it is a problem). Again, a hack, but does the trick until a clean solution is found.
$ts = mktime(); $now = gmdate("YmdHis", $ts + 120); $ns = $wgTitle->getNamespace(); $ti = wfStrencode($wgTitle->getDBkey()); $sql = "UPDATE cur SET cur_touched='$now' WHERE cur_namespace=$ns AND cur_title='$ti'"; wfQuery($sql, DB_WRITE, "kwBreadCrumbsNoCache");
-- Sebastien Barre
MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
:::: Nature must, in the not too distant future, institute bankruptcy proceedings against industrial civilization. -- William Catton :::: Jan Steinman http://www.Bytesmiths.com/Van
BTW: I had a weird problem while debugging Sebastien's cache hack. The cache dirty info, cur_touched, was not getting updated.
Then I found that my page Test:Fortune was in namespace zero, under its full name (Test:Fortune)! I moved it to Fortune, then back to Test:Fortune, and it began working, but it still has cur_title='Test:Fortune' and cur_namespace=0.
Perhaps I don't understand how namespaces work. I thought you could simply put 'Namespace:Name' at the end of a URL, and it would create a new namespace, but it seems Test behaves differently.
More puzzle: I queried for "cur_title LIKE '%:%" and I find all my Test namespaces are in namespace 0 (like Test:Fortune), and so are the pages in the 'Minutes' namespace that I thought I created.
Am I doing something wrong here? Or is this a known weirdness in 1.4b5?
:::: Base 8 is just like base 10, if you are missing two fingers. - Tom Lehrer :::: Jan Steinman http://www.Bytesmiths.com/Item/003AA08
Never mind, I'm reading [[Meta:Help:Custom_namespaces]] right now. My bad.
On 13 Mar 2005, at 20:35, Jan Steinman wrote:
Perhaps I don't understand how namespaces work. I thought you could simply put 'Namespace:Name' at the end of a URL, and it would create a new namespace...
:::: Our present economic system is... little more than a well-organized method for converting natural resources into garbage. -- Jay Hanson :::: Jan Steinman http://www.Bytesmiths.com/Van
mediawiki-l@lists.wikimedia.org