PDA

View Full Version : caching problems


stiej
04-29-2002, 04:05 PM
I have a problem trying to recall the html file containg the SWF file from another HTML file. It keeps gettin a cached copy. Someone recently suggested (to someone else) that you should call the swf/html file and append a questionmark and a variable similrar to htttp://mymovie.html?noCache="+random(10000)

Tried this to no avail. Have tried meta tags as suggested by help section on macromedia, still dont work.

HOWEVER, if i change the internet settings in Internet Explorer to "Every visit to the page" instead of "Automatically" (you can find these at Tools->Internet Options->Settings button (middle of dialog) I find this works perfectly. Every call to the swf/html file is retrieved from the server and my swf retrieves its variables from a text file off the server - just how i want it to do.

But, arguably it is wrong to expect users to change their browser settings.

Any ideas?

flashswami
05-01-2002, 08:22 AM
Do you know for sure if its the swf or the html file thats getting cached? You can get around the caching problem if its the html (in IE only AFAIK) by putting-


<meta http-equiv="Pragma" content="no-cache">


in the source of the html file. Between your < head > tags.

If its the swf caching then you have other problems. The solution involving the random number is used primarily to call external middleware scripts via loadVariables from inside the swf e.g.


on(release){
r=random(999);
loadvariablesNum("myscript.php", 0, "GET");
}


Which ensures that a random number is passed along to the script call thus resulting in a 'fresh' version of the script being called.