Chris/Joe, thanks a bunch, but here is my next question (just curious)...
Is it the SWF which is not getting reloaded every time the page is viewed and thus my data is not getting reloaded or is it my data file that is cached and therefore the browser just keeps reloading the same old data file, or is it both? One other item I notice is that I entered the url for the actual text file i was attempting to load and when I previewed that file it also contained old content and did not update until I performed a CTRL F5. Even attempting to clear the browser cache didn't seem to help.

*Don
*


Joseph Balderson wrote:
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 <dschn...@toolsforeducation.com <mailto:dschn...@toolsforeducation.com>> wrote:


    _______________________________________________
    Flashcoders mailing list
    Flashcoders@chattyfig.figleaf.com
    <mailto:Flashcoders@chattyfig.figleaf.com>
    http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to