14. Preloading the Applet and JVM

You can speed up the starting time of the editor by preloading the editor and or Java run-time environment.

On each start of the editor, the speed with which the editor is loaded mainly depends on two factors: whether the Java virtual machine is already started, and whether the applet JAR file is already cached in the JVM cache on the client side.

Usually at the very first start of the editor, neither of these factors will be the case, on thus the first start of the editor may take significantly longer than subsequent reloads of the editor.

Thus, you can now start the JVM and preload the editor JAR file into the JVM cache in the background of your page, independently of the editor itself. As this happens in the background, it does not affect your users and does not require starting the editor or integrating it into a page.

To this effect, the edit-on Pro JavaScript library contains two JavaScript functions, which allow you either to simply start the JVM before loading the applet, or to start the JVM and preload the applet JAR file into the JVM cache. These methods are preloadJVM and preloadApplet respectively.

It is highly recommended to include one of these functions in a page of your web application before the editor is actually loaded. If you are using preloadJVM, the JVM will already be started when accessing the page with the editor, which can cost quite some time on slower systems. However, on the very first start of the editor, it will still need to be downloaded into the client cache.

Example:

<script type="text/javascript" language="javascript" src="../../eopro/editonpro.js">
</script>

preloadApplet("eopro",
    true,
    "http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab",
    "1,4,2");

Note

It is highly recommended to preload the applet on a separate page that does not contain the editor itself, e.g. on the login screen of your application.