java web start 应用程序更新时是否可以强制清除缓存?
从命令行更新 java web start 应用程序时是否可以强制清除缓存?
Is it possible to force cache clearing when a java web start application is updated from the command line?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
就我个人而言,我会在开发时禁用缓存。
视窗:
- 转到控制面板/Java
Linux:
- $JAVA_HOME/bin/jcontrol
->临时 Internet 文件 ->设置->取消选中“在我的计算机上保留临时文件”
单击“删除文件”以清除所有缓存。
Personally, I'd disable the caching while developing.
Windows:
- Go go ControlPanel / Java
Linux:
- $JAVA_HOME/bin/jcontrol
-> Temporary Internet Files -> Settings -> Untick "Keep temporary files on my computer"
Click on "Delete files" to clear all cache while you at it.
根据Javaws文档,可以清楚缓存:
或
但是,几乎根据定义,如果应用程序正在更新,您不需要清除缓存。只是有时 Javaws 似乎不更新应用程序。
我已采取检查存储应用程序“最新版本”的 URL。当应用程序启动时,我会获取 URL 并与正在运行的版本进行比较。如果它们不同,我会弹出“有新版本可用 - 现在更新吗?”消息框。
如果用户选择更新,我使用(未显示适当的异常处理):
到目前为止,这似乎足够了,但如果有必要,我可以在 javaws 前面加上:
唯一的缺点是,如果您有桌面链接,系统将提示用户再次添加这些内容。但这只是让更新真正发挥作用所付出的很小的代价......
According to the Javaws documentation, you can clear the cache with:
or
However, almost by definition, you don't need to clear the cache if the application is being updated. It just seems that sometimes Javaws doesn't update applications.
I've resorted to checking a URL where I store the 'latest version' of my app. When the app starts, I fetch the URL and compare with the running version. If they differ, I popup a "There's a new version available - update now?" message box.
If the user selects to update, I use (with appropriate exception handling not shown):
So far that seems to be enough, but if necessary, I could preface the javaws with:
The only downside of this is that, if you have Desktop links, the user will be prompted to add those again. But that's a small price to pay to have updating actually working...
目前还没有办法从正在运行的应用程序内部清除缓存,或者至少我找不到一个。
Currently there is no way to clear the cache from inside the running application, or at least I was not able to find one.