检查浏览器是否正在使用缓存的 SWC/SWF?
您如何知道浏览器是否确实在为 Flex 项目使用缓存的 swf RSL/库?我希望能够根据用户是否从未下载过该库以及他们是否已通过浏览器缓存该库来从预加载器执行不同的操作。这可能吗?
How do you know if the browser is actually using the cached swf RSL/library for Flex projects? I would like to be able to do different things from the preloader based on whether or not the user has never downloaded the library vs. they have it already cached by their browser. Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道有任何标准方法可以做到这一点。
您可以在主类中声明一个
public static const VERSION_ID:String
并在每次构建中更改其值。现在,如果您使用 html 查询参数将最新版本 id 传递给预加载器,您可以在预加载器中读取它,然后将此版本 id 与加载的 SWF 的版本 id 进行比较。如果它们不匹配,则您拥有缓存版本。您可以通过将随机数附加到 SWF URL 来防止预加载器 SWF 缓存。
I am not aware of any standard way for doing this.
You can declare a
public static const VERSION_ID:String
in the main class and change its value in each build. Now if you pass the latest version id to the preloader using html query parameter, you can read it in the preloader and then compare this version id with the loaded SWF's version id. If they don't match, you have the cached version.You can prevent the preloader SWF from caching by appending a random number to the SWF url.