How to remove flash cache on a web site periodically
I'm using a flash rotating banner in my website which takes images and descriptions from an XML file.
I do changes to my XML very often... but in my local machine, the banner takes a day or two to get updated.
Although I can clear my local machine's cache, the problem still remains for other users who visit my web page..
is there a programmatic way in flash or in html to overcome this problem ? Maybe a server configuration? Please help me with this..
PS: below code works fine, but it clears out the cache completely... i need to clear XMl cache after a specific time period.. please help.
var timestamp:Date = new Date();
xmlData.load("/flash/images.xml?cachebuster=" + timestamp.getTime());
如果您想每天清除缓存,请使用以下命令:
var timestamp:Date = new Date();
xmlData.load("/flash/images.xml?cachebuster=" + timestamp.getMonth() + timestamp.getDate());
If you desperately need the XML to update continuously (like live-statistics) you can call the code each time your banner loops before populating your content.
In general, Sam's code is fine - often you don't need your flash to clear the XML after a time period - it only needs to clear each time the user views your banner.
链接地址: http://www.djcxy.com/p/17798.html上一篇: 读取和更新FLASH AS2中的外部数据
下一篇: 如何定期移除网站上的Flash缓存