I have a site (php-mysql) with some flash content. I need it regularly updated. But the problem is that, If I change any .swf (flash file) file and brouse the site the I, and my visitors see the old .swf file unless we clean our cokies or temp file. After doing that we can see new file. Is there any way to clean particular temp files or files related with my site from client (request) PC when they visits my site, so that they can see updated contents ? Is there any php or javascript code to doing this silently with my site?
If you know the location of the file you can use unlink() to get rid of it. The script would need to have write permissions to do so, but as long as you can upload/transfer into a directory, you should be able to delete from it as well. http://www.php.net/function.unlink
Once a browser caches content locally it will not be removed from the cache until after the expires date. One way around this is to add a parameter to the url of anything you want to force the end user to redownload. Example: mycontent.swf becomes mycontent.swf?v1 Just update the version number in your HTML each time you need to push a new version of the file
Your HTML code should look something like this (I have removed most of the attributes for brevity): <OBJECT id="myMovieName"> <PARAM NAME=movie VALUE="myFlashMovie.swf"> <EMBED href="http://www.mysite.com/flash/myFlashMovie.swf?version=1"></EMBED> </OBJECT> Each time you update your flash file you can append a version number to the end of the SWF URL. So, you would have URLs like: http://www.mysite.com/flash/myFlashMovie.swf?version=1 http://www.mysite.com/flash/myFlashMovie.swf?version=2 http://www.mysite.com/flash/myFlashMovie.swf?version=3 The browser will treat these URLs as new files and redownload them.
Or, you could try using Meta-tags - for instance EXPIRES or CONTENT-CONTROL NO CACHE - used together, these should prevent any caching of content on the webpage.