PDA

View Full Version : XML Caching using XMLConnector


nuxx
10-25-2004, 10:39 PM
I'm having a problem with an XML file being cached by both IE and Firefox, which is keeping my flash datagrid from updating with new data.

If I disable caching in the browser, it updates just fine.

I tried all the HTML meta tag tricks to disable caching, but none worked. The solution of adding a random number to the URL of the XML files looks like it could work, but I can't seem to add a random number to an XMLConnector under URL in the properties window for the XMLConnector.

Is there a way to hard code the URL of the XMLConnector, so I can specify the URL with a random number at the end? Or is there another way to stop caching?

Thanks a lot,
-Peter

nuxx
10-26-2004, 06:30 PM
unique=new Date().getTime()
xmlConn.URL = "http://localhost/xxxxxx/xxxxxx.xml?unique="+unique;
xmlConn.trigger();
_root.refreshTimer = setInterval(refresh, 10000);

function refresh() {
clearInterval(_root.refreshTimer);
unique=new Date().getTime()
xmlConn.URL = "http://localhost/xxxxxx/xxxxxx.xml?unique="+unique;
xmlConn.trigger();
// re-run the timer
_root.refreshTimer = setInterval(refresh, 10000);
}

That seems to work perfectly... thanks :-p
-Peter