当一个SWF(或其他外部远程资源)使用的SWFLoader加载,有没有进行任何客户端缓存或其他、缓存、客户端、加载

由网友(呆小萌)分享简介:想知道如果当外部远程资源(说的SWF,或JPG)在FLEX3使用的SWFLoader(或甚至图像部件)加载,如果有任何客户端(即浏览器缓存?)或加载的资源。特别是将第二个请求,那么访问previously访问的资源仅仅使用缓存的资源或将一个新的请求进行。这将是很好知道是否都是可能的(即告诉它总是使用一个新的负载或使用缓...

想知道如果当外部远程资源(说的SWF,或JPG)在FLEX3使用的SWFLoader(或甚至图像部件)加载,如果有任何客户端(即浏览器缓存?)或加载的资源。特别是将第二个请求,那么访问previously访问的资源仅仅使用缓存的资源或将一个新的请求进行。这将是很好知道是否都是可能的(即告诉它总是使用一个新的负载或使用缓存副本(如果可用))

Would like to know if when an external remote resource (say SWF, or JPG) is loaded using the SWFLoader (or even Image component) in flex3, if there is any client side (ie. browser caching?) or the loaded resources. In particular would a second request then to access a previously accessed resource just use the cached resource or would a new request be made. It would be nice to know if both are possible (ie. telling it to always use a fresh load or to use a cached copy if it is available)

推荐答案

浏览器负责缓存所有外部加载的媒体,如图像声音,视频,甚至主权财富基金。这些可以通过清除浏览器缓存中删除。我建议清除缓存按钮的Firefox附加组件测试的人有闪光灯项目在Firefox浏览器。

The browser is responsible for caching all externally loaded media, such as images sounds, videos and even SWFs. These can be deleted by clearing your browser cache. I recommend the Clear Cache Button Firefox Add-on for anyone testing there Flash projects in Firefox.

但是,Flash Player处理任何外部加载的签署 Flash组件,例如缓存任何Adobe Flex框架组件。你可以阅读更多有关的Flash播放器缓存这里 。清除浏览器缓存,将不会清除这些组件。

However, Flash Player handles caching of any externally loaded signed Flash components e.g. any Adobe Flex framework components. You can read more about Flash Players cache here. Clearing your browser cache, will not clear these components.

要停止进行缓存浏览器的文件,你需要确保它每次装入它的文件名是独一无二的。您可以通过添加一个随机字符串作为URL变量做到这一点。我通常使用当前时间,或一个随机数:

To stop a file being cached by your browser, you will need to make sure its filename is unique each time it is loaded. You can do this by appending a random string as a URL variable. I usually use the current time, or a random number:

var noCache:int = new Date().getTime();
myImage.load("filename.jpg?uniq=" + noCache);

或者你也可以使用的URLVariables 类。

阅读全文

相关推荐

最新文章