Java Web Start - 如何清除缓存(或从用户的角度更新应用程序)

发布于 2024-12-26 11:18:39 字数 278 浏览 4 评论 0原文

JNLP 在浏览器中下载后,它会被缓存,因此不需要再次下载,这很好。但是,因此,如果我更新 JNLP 使用的 JAR,用户仍然会看到缓存中的旧版本应用程序。

您可以通过在终端中运行此命令来清除缓存:

javaws -uninstall

但显然,您不能指望用户在更新准备就绪时运行此命令。它应该比这更无缝。

一种想法是更改 jnlp 文件名,以便他们下载新文件(例如 MyJWS-01.jnlp)以包含版本号。

还有其他办法吗?

After the JNLP gets downloaded in the browser it becomes cached so it doesn't need to be downloaded again, which is good. However, as a consequence, if I update the JAR that the JNLP uses, users will still see the old version of the app that is in the cache.

You can clear the cache by running this in the terminal:

javaws -uninstall

But obviously you could not expect from users to run this when your update is ready. It should be more seamless than that.

One idea is to change the jnlp file name so they download new file, like MyJWS-01.jnlp, to include version numbers.

Is there any other way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

我的痛♀有谁懂 2025-01-02 11:18:39

"The update element is used to indicate the preferences for how application updates should be handled by Java Web Start." The default attribute values would seem to "to check for updates until timeout" and "to always download updates without any prompt." For example,

<update check="timeout" policy="always"/>

Are you getting a different result?

熟人话多 2025-01-02 11:18:39

您还可以使用 jnlp 属性 name="jnlp.versionEnabled"value="true" ,您可以在其中输入 jar 的特定版本号,这样当您发布新版本时,将交付新版本。

You can also use the jnlp property name="jnlp.versionEnabled" and value="true" where you can enter a specific version number for the jar, and that way a new one will be delivered when you release a new version.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文