Java Web Start - 如何清除缓存(或从用户的角度更新应用程序)
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“更新元素用于指示
Java Web Start
。”默认属性值似乎是“检查更新直到超时”和“始终在没有任何提示的情况下下载更新”。例如,您得到不同的结果吗?
"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,Are you getting a different result?
您还可以使用 jnlp 属性
name="jnlp.versionEnabled"
和value="true"
,您可以在其中输入 jar 的特定版本号,这样当您发布新版本时,将交付新版本。You can also use the jnlp property
name="jnlp.versionEnabled"
andvalue="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.