Reputation: 1237
We got performance hit in one of the Java-Applet based web application. So we implemented JNLP concept to improve applet loading.
As per JNLP,
The JAR files will be downloaded to client machine for the first time and will be cached locally
If the applet version in the server matches the applet version in the cache, the applet will not be downloaded instead it will be loaded from the cache
If there is any change in JAR version in the server side, the old JAR in the cache will be replaced with the new JAR
But In our application, it is not working as expected. We found that the jnlp file itself is coming from cache hence it is containing the old jar version.
Is there any way that jnlp file alone should be freshly download everytime a browser is closed an opened? or is there any onther alternaive way to fix this?
Any help is much appreciated!!
JNLP File
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="" version="2.0.0.0">
<information>
<title>Active Viewer</title>
<vendor>Platts</vendor>
<offline-allowed/>
</information>
<resources>
<j2se version="1.6+"
href="http://java.sun.com/products/autodl/j2se"/>
<jar href="EWSApplet.jar" main="true" version="9.3.5.0" />
<property name="jnlp.versionEnabled" value="true"/>
</resources>
<applet-desc name="EWSApplet"
main-class="com.mycompany.ew.applet.EWS_Config.EWS_Config.class"
width="1"
height="1">
</applet-desc>
<update check="background" policy="always"/>
</jnlp>
Upvotes: 1
Views: 4694
Reputation: 51
i asume you download the jnlp file from some kind of webserver? If yes, then you should look closer to the website linking to the jnlp. Perhaps adding something like foobar.jnlp?version=xx.yy.zz can help. The ?version=xx.yy.zz will be handled as GET-Parameters by the server (and therefore ignored by file selection) but are not ignored by the browser while caching.
Greetings
Upvotes: 1
Reputation: 88707
You could try to set the JNLP file to expire immediately in your browser, i.e. when downloading it set the corresponding headers like expires
, cache-control
, the no-cache
pragma etc. (normally you need several for all the different browsers).
Upvotes: 2