views:

43

answers:

5

Hi,

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?

+2  A: 

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.

Tim
that will make it to download everytime? I don't want the user to download it if I didn't make modification.
Bin Chen
Just change the variable when the file changes, or version your filenames and change that when you update the flash asset...
pharalia
@pharalia - exactly...a version number on the query string should ensure that the file is cached until it changes.
Tim
A: 

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

Thikron
how about my user?
Bin Chen
+2  A: 

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).

alxx
A: 

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

julien
A: 

That's because the browser cache.

Mobius