开发者

ie/firefox and flash: what's the refresh algorithm

开发者 https://www.devze.com 2023-01-19 02:06 出处:网络
I made a flash and embed it into a webpage. I use the browser to test the flash, an intersting thing, after I upload开发者_运维问答 the flash into the server, and press F5 to refresh the browser, the

I made a flash and embed it into a webpage. I use the browser to test the flash, an intersting thing, after I upload开发者_运维问答 the flash into the server, and press F5 to refresh the browser, the browser still use the old one, I can't enforce the browser to use the new flash swf file!

How can I tell browser to use the new swf?


Try appending a random (and meaningless) query string to the URL of the SWF. That way, the browser thinks it's a new file and will download it again from the server.


If you append random query string to your swf file in javascript, as Tim suggests, following things will happen:

  • swf will be loaded every time from server (no caching at all)
  • browser cache will be populated with copies of your swf (one after each request, if browser is not smart enough to compare file contents)

I think it's best to append version to your swf and update it (like name1.0.swf, name1.1.swf and so on).


Another option is to delete the browser cache, if you don't want to rename your file everytime you make a modification.


For Firefox you can use FireBug for disable the browser cache.

0

精彩评论

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