开发者

SwfUpload: prevent_swf_caching in other browsers than IE?

开发者 https://www.devze.com 2023-04-05 20:18 出处:网络
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.

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 }
0

精彩评论

暂无评论...
验证码 换一张
取 消