views:

28

answers:

3

Hi guys,

I developed a flex website, the web explorer always caches swf file which embedded in HTML. Sometimes I make changes to the flex file, clients computer still view the previous version which stored in cache. How can I force client's web explorer to reload/refresh the swf file?

Thanks

+1  A: 

You can add a version number to the URL of the swf file, kind of like this:

<object ...
   <param name="movie" value="my.swf?version=2" />
   ...
   <embed src="my.swf?version=2" ...
</object>

When you have a new changed swf file, you also change the version number in the URL, so the next time it will be my.swf?version=3 and so on.

It doesn't need to be a version number, the idea is simply that since the URL to the swf is new, the browser wont use a cached file.

Lars
A: 

Three (different) ways:

1) Try the no-cache tags

http://www.i18nguy.com/markup/metatags.html

2) Use a preloader, which is a flash movie that loads the swf

3) Add the swf to the page with javascript and add a random url variable to the end to make it a different name every time, and therefore forces the browser to reload it

Organiccat
A: 

I would use jQuery and simply delete it then put it back.

I use that on my pages and it works very well

Mark