* Daniel Barrett danb@VistaPrint.com [Mon, 17 Oct 2011 21:26:19 +0000]:
(Reposted from mediawiki-l due to zero responses.)
I've been adding custom tools to the WikiEditor toolbar (MW 1.17.0 version) and am running into difficulty with browser caching.
When I do something simple, such as adding a button or changing text
in
a dialog, the change doesn't take effect in my browser due to caching. Even if I hard-refresh (ctrl-F5), the changes do not appear. I have to delete my browser's cached content (e.g., in Firefox, Tools / Options
/
Advanced / Network / "Clear Now") to see the change. That seems
extreme:
a browser refresh or hard-refresh ought to be sufficient, right? Or ideally, no refresh at all.
This is in Firefox 7.1, Firefox 3.6, and IE8.
For example, I created a new dialog:
$('#wpTextbox1') .wikiEditor('addModule', { 'dialogs': { 'mytool-module': { title: "My title", id: 'mytool', html: function() { return '<p>foo bar</p>'; }, ...
which is launched from a button:
$('#wpTextbox1') .wikiEditor('addToToolbar', { 'section': 'main', 'group': 'insert', 'tools': { 'mytool': { 'label': 'my label', 'type': 'button', 'icon': mypath, 'action': { 'type': 'dialog', 'module': 'mytool-module' } } } } );
Now if I modify the HTML of the dialog to be "foo bar BLAT" instead of "foo bar", I still see "foo bar" until I clear the browser cache.
However, I can change other parts (say, the button label) without this caching happening.
Is there something else special I should be doing to avoid this level
of
heavy caching?
For Firefox there is WebDeveloper extension https://addons.mozilla.org/ru/firefox/addon/web-developer/ which has menu to disable browser caching. In IE8 / IE9 there is menu to disable caching when you run debugger via F12.
I must agree with you that modern browsers are caching the content beyond the evil. And Firefox always was a "pioneer" in that. http://support.mozilla.com/ru/questions/806805
They've got it to the point when DOM is properly altered by the script, however different content is displayed (not matched to DOM state):
"With old versions of Firefox it was possible to fix aggressive client-side caching by restoring of the form values programmatically in Javascript body.onload handler. With FF4 now this does not work. I set selected option values, these are properly stored in DOM tree (according to Firebug inspector), however visual display of select/option is not updated. This is a plain bug, imo."
Dmitriy