This is a silly post. I'm going to write something that probably everyone else in the whole Flex world already knows. But I didn't know this. And it was helpful for me.
For a project I'm working on we are having to integrate a feature that uses a .swc provided by the client. This feature, which we are merely integrating and didn't have technical control over the implementation, requires that the Flex application run from a Web server (from an http directive, not from a file directive) in the browser or it won't work. I thought that was annoying, but I realized just how annoying it really was after I ran it from Apache (which I just installed on my machine for this purpose) and my new trace statements didn't show up. After a few minutes I realized it was because the .swf was cached by Firefox. I could clear the cache every time just before running the application. But that was not a very workable solution. instead, I wanted to disable caching entirely.
The way I found to disable caching from Firefox is to run Firefox and in the address bar type about:config. This will take you to a page with a datagrid and a bunch of configuration settings for Firefox. I set browser.cache.disk.enable and browser.cache.memory.enable both to false.
That was all I had to do to disable caching. Oh, and it does occur to me that I *could* have customized the .html template FlexBuilder is using in order to load the .swf with a unique query string value each time, which would have solved the caching issue in a different way. But disabling caching in Firefox entirely seemed far more silly. Plus, it required far less work.
choosing the silliest option sounds like a fantastic philosophy to live by.
You should have a look at this book: ‘High Performance Web Sites’ or http://www.mnot.net/cache_docs/.
Disabling the browser cache is not a good solution. You could cache the swf forever (using ‘Cache-Control: max-age=315360000′ header), add a version number in the swf name and ask the browser to check for newer version of the html file each time (‘Cache-Control: no-cache’).
An easier way to do this is to download the “Web Developer” Firefox plugin. Look for “Disable” on the new tool bar and check “Disable Cache”.
It’s probably doing what you did under the covers, but I think this is a bit faster if you are in a situation where you need to frequently turn the cache on and off.