检查浏览器是否正在使用缓存的 SWC/SWF?

发布于 2024-08-13 22:31:36 字数 98 浏览 11 评论 0原文

您如何知道浏览器是否确实在为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

十六岁半 2024-08-20 22:31:36

我不知道有任何标准方法可以做到这一点。

您可以在主类中声明一个 public static const VERSION_ID:String 并在每次构建中更改其值。现在,如果您使用 html 查询参数将最新版本 id 传递给预加载器,您可以在预加载器中读取它,然后将此版本 id 与加载的 SWF 的版本 id 进行比较。如果它们不匹配,则您拥有缓存版本。

您可以通过将随机数附加到 SWF URL 来防止预加载器 SWF 缓存。

<embed src="Preloader.swf?versionID=10&<?php echo "rand=".rand(1, 10000)."\""?>

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.

<embed src="Preloader.swf?versionID=10&<?php echo "rand=".rand(1, 10000)."\""?>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文