开发者

Preventing cache of swf using Java

开发者 https://www.devze.com 2023-01-27 14:42 出处:网络
I want to load the swf everytime its changed. I have written a class which returns path wit开发者_运维技巧h modified time.

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

精彩评论

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

关注公众号