Preventing cache of swf using Java
I want to load the swf everytime its changed. I have written a class which returns path wit开发者_运维技巧h modified time.
I am loading the swf using Loader in flex.
public class CacheBustingService {
public static String getTimeStamp(String inPath)
{
File file = new File(inPath);
String modified = file.lastModified()+"";
return modified+inPath;
}
}
I have also tried adding modified time in query string like: inPath?modifiedTime=modified Its not working. Can anybody suggest me better way to achieve this?
You can add a Filter that is mapped to *.swf
and adds Expires: -1
, and other cache-preventing headers.
精彩评论