I'm using SwfUpload and in a page speed optimization project I noticed that in the default setting swfupload prevents loading of the swfupload.swf by appending a random querystring.
This is 开发者_高级运维beacause of an IE bug when the swf is fetched from cache.
But I really want to cache this file. :(
Is this an acceptable workarbound for at least not caching other browsers than IE:
prevent_swf_caching:!!$.browser.msie,
Revelvant code is:
if (!!this.settings.prevent_swf_caching) {
this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime();
}
/*snip*/
this.ensureDefault("prevent_swf_caching", true);
So, when you initialize it, just pass the user setting of
{"prevent_swf_caching": !$.browser.msie }
精彩评论