开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜