Java小程序缓存永远不下载新版本吗? [英] Java applet cached forever, not downloading new version?

查看:142
本文介绍了Java小程序缓存永远不下载新版本吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有客户的地方似乎是永远缓存小应用程序的版本情况。这里我们使用了&LT的; PARAM NAME =cache_version> 标记正确地在我们的<对象> 标签,或者我们认为。我们从 7.1.0.40 的版本字符串到 7.1.0.42 ,这引发了下载大约只有一半我们的客户。

这似乎并不重要客户端运行该版本的JRE。我们已经看到了人们对1.4,1.5和1.6这个问题。

是否有人有明确的缓存版本的经验?它的工作原理更可靠(忽略速度),而不是依赖于 cache_archive 的上次修改和/或的Content-Length值(按的 Sun的网站)?

仅供参考,对象块看起来是这样的:

 <对象>
  < PARAM NAME =ARCHIVEVALUE =foo.jar中>
  < PARAM NAME =code值=com.foo.class>
  <参数名=codeBase的价值=>
  < PARAM NAME =cache_archiveVALUE =foo.jar中>
  < PARAM NAME =cache_versionVALUE =7.1.0.40>
  < PARAM NAME =NAME值=FooApplet>
  < PARAM NAME =输入值=应用程序/ x-j​​ava的小程序,JPI版本= 1.4.2_13>
  < PARAM NAME =脚本化VALUE =真>
  < PARAM NAME =进度值=真/>
  < PARAM NAME =boxmessage值=正在加载网页Applet的工作表.../>
< /对象>


解决方案

不幸的是,不同版本的Java插件具有不同的缓存行为。设置你的Cache-Control和最后修改HTTP头是理想的解决方案,但它只有在的最新版本的JRE。

保证工作的唯一解决办法是,当它们的版本改变重命名你的应用程序罐子(试图像基于文件日期添加查询字符串其他的技巧时,我们已经看到了奇怪的缓存行为)。如果你有一个正确的自动部署系统,这是不是那么难的事。

We have a case where clients seem to be eternally caching versions of applets. We're making use of the <param name="cache_version"> tag correctly within our <object> tag, or so we think. We went from a version string of 7.1.0.40 to 7.1.0.42 and this triggered a download for only about half of our clients.

It doesn't seem to matter which version of the JRE the client is running. We've seen people have this problem on 1.4, 1.5 and 1.6.

Does anybody have experience with explicit cache versions? Does it work more reliably (ignoring speed) to instead rely on the cache_archive's "Last-Modified" and/or "Content-Length" values (as per Sun's Site)?

FYI, object block looks like this:

<object>
  <param name="ARCHIVE" value="foo.jar">
  <param name="CODE" value="com.foo.class">
  <param name="CODEBASE" value=".">
  <param name="cache_archive" value="foo.jar">
  <param name="cache_version" value="7.1.0.40">
  <param name="NAME" value="FooApplet">
  <param name="type" value="application/x-java-applet;jpi-version=1.4.2_13">
  <param name="scriptable" value="true">
  <param name="progressbar" value="true"/>
  <param name="boxmessage" value="Loading Web Worksheet Applet..."/>
</object>

解决方案

Unfortunately, different versions of the Java Plug-In have different caching behaviors. Setting your Cache-Control and Last-Modified HTTP headers is the ideal solution, but it only works under the most recent versions of the JRE.

The only solution GUARANTEED to work is to rename your application jars when their versions change (we've seen strange caching behavior when trying other tricks like adding query strings based on file dates). This isn't so difficult to do if you have a properly automated deployment system.

这篇关于Java小程序缓存永远不下载新版本吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆