View Full Version : MediaPanel caching my swf!

21 Apr 2010, 7:27 AM
I have a MediaPanel displaying a swf. I have a form that alters the file that the swf reads. The problem is, IE caches the swf file and doesn't update the swf when I make changes to the form. Chrome and Firefox both don't cache the file. But my customer ... ".mil" can't use Chrome or Firefox.

Here's the code sample. As you see, I have disableCaching = true and I've changed the URL of the swf to include a timestamp. I've even tried to sell having users set "Check for newer versions of stored pages" set to "every time". That didn't fly.

function getChart() {
var ts = new Date();
var se = ts.getMilliseconds();
var swfUrl = '/approot/index.swf';
swfUrl += '?time=' + se;

var tmpPanel = new Ext.ux.MediaPanel({

disableCaching: true,
mediaCfg: {
mediaType: 'SWF',
url: swfUrl



I'd appreciate any insight or suggestions of new things to try.

21 Apr 2010, 10:22 AM
IE is such a pain, and I feel for you, but I think I offer no other advice than the one you already tried, so I feel for you.

Seeing as you are using M$ technology, have you tried creating a web service, that just sends a content-type "swf" stream.

22 Apr 2010, 4:54 AM
Thanks for the sympathy Crazy. IE is indeed a pain.

Does anyone have some anti-caching strategies that might be applicable?

23 Apr 2010, 1:16 PM
It turns out that IE was caching the file as well as the SWF. When I added a "math" to the file inside the SWF the caching stopped. So for IE always append a timestamp to your files to prevent caching.