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.
精彩评论