You cannot prevent a file from being cached in the browser; what most "cache" settings are designed to do is prevent session information and cookies from being cached. The best you can do is force the browser to grab the file from the server each and every time it is viewed, which acheives the desired effect.

To do that, all you need is to add the following js to your html file:

..."Main.swf?nocache="+(new Date()).getTime()

I wrote a tutorial on adding this to the flex html template:
http://www.communitymx.com/abstract.cfm?cid=32F44

This appends a unique number on the end of the file name, tricking the browser into thinking it's getting a new file every time, thus downloading the SWF from the server every time. You can use an equivalent of this technique in ActionScript for loading modules you don't want "cached" as well.

I would not recommend this technique for production, as it will spike your server load something terrible, but for testing it's essential.
_______________________________________________________________________

Joseph Balderson, Flex & Flash Platform Developer :: http://joeflash.ca
Author, Professional Flex 3 :: http://tinyurl.com/proflex3book


Don Schnell - TFE wrote:

Thanks William, I am not sure why there was no text in my original post but my issue is how to prevent data from being cached in IE & Firefox. My SWFs load in data from a flat text file and I tried using the following No-Cache settings before the head but they don't seem to prevent this issue.

// prevent browser cache
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");



William Chadwick wrote:
Not sure what you want, as there is no text in your message.

But if you want to know about how SharedObject's work, here you go.
Local SharedObjects (AKA 'Flash Cookies') are stored in the following path in a directory with a random name: C:\Documents and Settings\USERNAME\Application Data\Macromedia\Flash Player\#SharedObjects

There are some really clear articles on them on Adobe's devnet.

William Chadwick

On Thu, Sep 24, 2009 at 5:06 PM, Don Schnell - TFE <[email protected] <mailto:[email protected]>> wrote:


    _______________________________________________
    Flashcoders mailing list
    [email protected]
    <mailto:[email protected]>
    http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to