Reputation: 375
We have an application running with java web start. It works great, and it is launched with an HTML link to JNLP.
However, we need to launch this app several times a day. Is there a way to not download it every single time we want to launch it ? I though that would be put in cache in order to download it only the first time or after updates.
Upvotes: 1
Views: 1711
Reputation: 6059
Include the offline-allowed
option in your JNLP file.
I'll quote from the documentation (relevant parts highlighted by me):
offline-allowed element: The optional offline-allowed element indicates if the application can be launched offline.
If offline-allowed is specified, then the application can be launched offline by the Java Application Cache Viewer, and shortcuts can be created which launch the application offline.
If an application is launched offline, it will not check for updates and the API call BasicService.isOffline() will return true.
The offline-allowed element also controls how Java Web Start checks for an update to an application. If the element is not specified—i.e., the application is required to be online to run—Java Web Start will always check for an updated version before launching the application. And if an update is found, the new application will be downloaded and launched. Thus, it is guaranteed that the user always runs the latest version of the application. The application, however, must be run online.
If offline-allowed is specified, Java Web Start will also check to see if an update is available. However, if the application is already downloaded the check will timeout after a few seconds, in which case the cached application will be launched instead. Given a reasonably fast server connection, the latest version of the application will usually be run, but it is not guaranteed. The application, however, can be run offline.
Upvotes: 2